Class DIExtensions
Inheritance
System.Object
DIExtensions
Namespace: Reveal.Sdk
Assembly: Infragistics.Reveal.SDK.WebAPI.dll
Syntax
public static class DIExtensions : Object
Methods
AddReveal(IMvcBuilder)
Adds default configured Reveal services. The behavior would be exactly the same as shown in the example bellow.
Declaration
public static IMvcBuilder AddReveal(this IMvcBuilder mvcBuilder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IMvcBuilder | mvcBuilder |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IMvcBuilder |
Examples
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc().AddReveal(builder =>
{
builder
.AddDashboardProvider(new RVDashboardProvider("Dashboards"))
.AddSettings(s => s.LocalFileStoragePath = "Data");
});
...
}
AddReveal(IMvcBuilder, Action<RevealSetupBuilder>)
Adds Reveal services to the specified Microsoft.Extensions.DependencyInjection.IMvcBuilder. This method registers default dashboard provider and sets the LocalFileStoragePath settings.
Declaration
public static IMvcBuilder AddReveal(this IMvcBuilder mvcBuilder, Action<RevealSetupBuilder> setupAction)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IMvcBuilder | mvcBuilder | |
System.Action<RevealSetupBuilder> | setupAction | An action that has RevealSetupBuilder as an argument which you could use to register your implementations for some services |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IMvcBuilder |
Examples
public void ConfigureServices(IServiceCollection services)
services.AddMvc().AddReveal(builder =>
{
builder
.AddDashboardProvider<MyDashboardProvider>();
.AddAuthenticationProvider<MyAuthenticationProvider>()
.AddDataSourceProvider<MyDataSourceProvider>()
.AddUserContextProvider<MyUserContextProvider>()
.AddDataProvider<MyDataProvider>()
.AddSettings(s => s.LocalFileStoragePath = "Data");
});
}