MvcBuilderExtension.AddDefaultDashboardController(IMvcBuilder, Action<DashboardConfigurator>) Method
OBSOLETE
Use dependency injection to add Dashboard
Adds the dashboard controller and provides access to the DashboardConfigurator settings.
Namespace: DevExpress.DashboardAspNetCore
Assembly: DevExpress.Dashboard.v24.2.AspNetCore.dll
NuGet Package: DevExpress.AspNetCore.Dashboard
#Declaration
[Obsolete("Use dependency injection to add DashboardConfigurator to services directly.")]
public static IMvcBuilder AddDefaultDashboardController(
this IMvcBuilder mvcBuilder,
Action<DashboardConfigurator> configure
)
#Parameters
Name | Type | Description |
---|---|---|
mvc |
IMvc |
An interface for configuring MVC services. |
configure | Action<Dashboard |
A delegate that provides access to the Dashboard |
#Returns
Type | Description |
---|---|
IMvc |
An interface for configuring MVC services. |
#Remarks
From v21.2, this method is obsolete due to security reason. Use dependency injection instead.
Register the DashboardConfigurator
as a service based on your requirements. The AddSingleton
method registers the DashboardConfigurator service with the same service lifetime as AddDefaultDashboardController
. However, we recommend that you use the AddScoped
method as it can be used in more cases (for example, security-based scenarios like multi-tenancy dashboards).
services.AddScoped<DashboardConfigurator>((IServiceProvider serviceProvider) => {
DashboardConfigurator configurator = new DashboardConfigurator();
// content
return configurator;
});
More information: Breaking Change T1018632: Web Dashboard - The DashboardController class became abstract.