Flexmonster Data Server can be embedded in your project as a DLL – a separate flexible module. The advantages of using a DLL instead of the console application are the following:
For a quick start with Flexmonster Data Server as a DLL, see the sample .NET Core application with the Data Server embedded.
To embed Flexmonster Data Server into an existing/new .NET Core application, see this guide: Referring the Data Server as a DLL.
Flexmonster.DataServer.Core.dll is a flexible solution that can be used in many ways. To demonstrate possible options for the Data Server use, we created an ASP.NET Core application with a custom server using Flexmonster.DataServer.Core.dll.
The application repository contains a solution file
DemoDataServerCore.sln, so the sample can be opened and launched via Visual Studio.
To run the sample project, you need Microsoft .NET Core 3.0 or higher. Get it here if it’s not already installed on your machine.
To start the sample application from the console, run the following commands:
To see the result, open
http://localhost:5000/ in the browser.
Flexmonster.DataServer.Core.dll, you can provide role-based access to the data. Showing different data subsets to different user groups is possible with the server filter. On the
http://localhost:5000/ page, there is the pivot table and the drop-down menu. Select a role from the menu to see how it affects the data shown in Flexmonster Pivot. To see how the server-side filtering is implemented in the sample server, refer to the FlexmonsterAPIController.cs file.
Another use case demonstrated in the custom server is loading data from a custom data source. To work with the custom data source, implement an appropriate parser for the data. The example of a custom parser can be viewed in the CustomParser.cs file.
In the sample project, the data shown on the grid is from the custom parser, but
"database" parser types can also be used. To make the server use several parsers, add a new object to the
"DataSources" property in the
appsettings.json file. For example:
You may be interested in the following articles: