Source/Csla.Blazor.WebAssembly/ConfigurationExtensions.cs
/// <summary>
/// Configures the application to use CSLA .NET
/// in a Blazor WebAssembly runtime
/// </summary>
/// <param name="builder">IWebAssemblyHostBuilder object</param>
/// <param name="config">Implement to configure CSLA .NET</param>
Configures the application to use CSLA .NET
in a Blazor WebAssembly runtime
Configures the application to use CSLA . NET in a Blazor WebAssembly runtime
public static WebAssemblyHostBuilder UseCsla(
      this WebAssemblyHostBuilder builder, Action<CslaConfiguration> config)
    {
      builder.Services.AddCsla();
      DataPortalClient.HttpProxy.UseTextSerialization = true;
      builder.Services.TryAddTransient(typeof(ViewModel<>), typeof(ViewModel<>));
      builder.Services.TryAddSingleton<IAuthorizationPolicyProvider, CslaPermissionsPolicyProvider>();
      builder.Services.TryAddSingleton<IAuthorizationHandler, CslaPermissionsHandler>();
      CslaConfiguration.Configure().
        ContextManager(typeof(Csla.Core.ApplicationContextManagerStatic));
      config?.Invoke(CslaConfiguration.Configure());
      return builder;
    }
public static WebAssemblyHostBuilder UseCsla ( this WebAssemblyHostBuilder builder , Action < CslaConfiguration > config ) { builder . Services . AddCsla ( ) ; DataPortalClient . HttpProxy . UseTextSerialization = true ; builder . Services . TryAddTransient ( typeof ( ViewModel < > ) , typeof ( ViewModel < > ) ) ; builder . Services . TryAddSingleton < IAuthorizationPolicyProvider , CslaPermissionsPolicyProvider > ( ) ; builder . Services . TryAddSingleton < IAuthorizationHandler , CslaPermissionsHandler > ( ) ; CslaConfiguration . Configure ( ) . ContextManager ( typeof ( Csla . Core . ApplicationContextManagerStatic ) ) ; config ? . Invoke ( CslaConfiguration . Configure ( ) ) ; return builder ; }
Configures the application to use CSLA .NET
in a Blazor WebAssembly runtime
Configures the application to use CSLA . NET in a Blazor WebAssembly runtime
WebAssemblyHostBuilder
this
config
Action<CslaConfiguration>
Implement to configure CSLA .NET
Implement to configure CSLA . NET
builder
None