RouteBuilderExtension Class
Provides extension methods to configure routing for the Web Dashboard.
Namespace: DevExpress.DashboardAspNetCore
Assembly: DevExpress.Dashboard.v24.2.AspNetCore.dll
Declaration
Remarks
Routing functionality is responsible for mapping an incoming request to a route handler. ASP.NET Core applications support two routing types: the endpoint routing and routing at the MVC level. The endpoint routing is set as a default routing. The Web Dashboard can use both routing types.
The code sample below shows how to set a default dashboard route handler for endpoint routing. The route prefix is api/dashboard
and the controller name is DefaultDashboard
:
// Maps the dashboard route.
app.MapDashboardRoute("api/dashboard", "DefaultDashboard");
A route prefix is used to handle requests from the client-side DashboardControl. Use the following properties in the client applications to specify the endpoint:
- Client app with DashboardControl: DashboardControlOptions.endpoint
- ASP.NET Core Razor app: DashboardBackendOptionsBuilder.Uri
- ASP.NET MVC Razor app: DashboardBackendOptions.Uri