Skip to main content
A newer version of this page is available. .

MvcBuilderExtension.AddDefaultDashboardController(IMvcBuilder, Action<DashboardConfigurator>) Method

Adds the dashboard controller and provides access to the DashboardConfigurator settings.

Namespace: DevExpress.DashboardAspNetCore

Assembly: DevExpress.Dashboard.v18.2.AspNetCore.dll

Declaration

public static IMvcBuilder AddDefaultDashboardController(
    this IMvcBuilder mvcBuilder,
    Action<DashboardConfigurator> configure
)

Parameters

Name Type Description
mvcBuilder IMvcBuilder

An interface for configuring MVC services.

configure Action<DashboardConfigurator>

A delegate that provides access to the DashboardConfigurator settings.

Returns

Type Description
IMvcBuilder

An interface for configuring MVC services.

Remarks

Use the AddDefaultDashboardController method to add the dashboard controller and register a default DashboardConfigurator instance as a singleton lifetime service in the dependency injection engine. This method also provides access to the DashboardConfigurator that is registered in the dependency injection as a default dashboard configurator:

using DevExpress.DashboardAspNetCore;
using Microsoft.Extensions.DependencyInjection;

// ...

public void ConfigureServices(IServiceCollection services) {
    services
        .AddMvc()
        .AddDefaultDashboardController((configurator)  => {
            // Configure dashboard server-side settings like a dashboard storage, predefined data sources, etc.
        });
}
See Also