|
10 | 10 | using Microsoft.AspNetCore.Authorization;
|
11 | 11 | using Microsoft.AspNetCore.Components.Authorization;
|
12 | 12 | using Microsoft.Extensions.DependencyInjection;
|
13 |
| -using Microsoft.Extensions.DependencyInjection.Extensions; |
14 | 13 | using Csla.Blazor.WebAssembly.Configuration;
|
15 | 14 |
|
16 | 15 | namespace Csla.Configuration
|
@@ -40,11 +39,11 @@ public static CslaOptions AddBlazorWebAssembly(this CslaOptions config, Action<B
|
40 | 39 | options?.Invoke(blazorOptions);
|
41 | 40 |
|
42 | 41 | config.Services.AddScoped((_) => blazorOptions);
|
43 |
| - config.Services.TryAddTransient(typeof(ViewModel<>), typeof(ViewModel<>)); |
44 |
| - config.Services.TryAddScoped<IAuthorizationPolicyProvider, CslaPermissionsPolicyProvider>(); |
45 |
| - config.Services.TryAddScoped<IAuthorizationHandler, CslaPermissionsHandler>(); |
46 |
| - config.Services.TryAddScoped(typeof(Csla.Core.IContextManager), typeof(Csla.Blazor.WebAssembly.ApplicationContextManager)); |
47 |
| - config.Services.TryAddScoped(typeof(AuthenticationStateProvider), typeof(Csla.Blazor.Authentication.CslaAuthenticationStateProvider)); |
| 42 | + config.Services.AddTransient(typeof(ViewModel<>), typeof(ViewModel<>)); |
| 43 | + config.Services.AddScoped<IAuthorizationPolicyProvider, CslaPermissionsPolicyProvider>(); |
| 44 | + config.Services.AddScoped<IAuthorizationHandler, CslaPermissionsHandler>(); |
| 45 | + config.Services.AddScoped(typeof(Csla.Core.IContextManager), typeof(Csla.Blazor.WebAssembly.ApplicationContextManager)); |
| 46 | + config.Services.AddScoped(typeof(AuthenticationStateProvider), typeof(Csla.Blazor.Authentication.CslaAuthenticationStateProvider)); |
48 | 47 |
|
49 | 48 | // use Blazor state management
|
50 | 49 | config.Services.AddScoped(typeof(ISessionManager), blazorOptions.SessionManagerType);
|
|
0 commit comments