Browse Source
Merge pull request #13545 from abpframework/IClientScopeServiceProviderAccessor
Use `IClientScopeServiceProviderAccessor` to get scoped services.
pull/13547/head
Enis Necipoglu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs
-
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
|
|
|
@ -7,6 +7,7 @@ using Volo.Abp.AspNetCore.Components.Web; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling; |
|
|
|
using Volo.Abp.AspNetCore.Components.Web.Security; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.Client; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
using Volo.Abp.Http.Client; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
@ -46,8 +47,8 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule |
|
|
|
|
|
|
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
await context.ServiceProvider.GetRequiredService<WebAssemblyCachedApplicationConfigurationClient>().InitializeAsync(); |
|
|
|
await context.ServiceProvider.GetRequiredService<AbpComponentsClaimsCache>().InitializeAsync(); |
|
|
|
await context.ServiceProvider.GetRequiredService<IClientScopeServiceProviderAccessor>().ServiceProvider.GetRequiredService<WebAssemblyCachedApplicationConfigurationClient>().InitializeAsync(); |
|
|
|
await context.ServiceProvider.GetRequiredService<IClientScopeServiceProviderAccessor>().ServiceProvider.GetRequiredService<AbpComponentsClaimsCache>().InitializeAsync(); |
|
|
|
await SetCurrentLanguageAsync(context.ServiceProvider); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
using Volo.Abp.EventBus; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
@ -19,6 +20,6 @@ public class AbpAspNetCoreMvcClientModule : AbpModule |
|
|
|
|
|
|
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
await context.ServiceProvider.GetRequiredService<MvcCachedApplicationConfigurationClient>().InitializeAsync(); |
|
|
|
await context.ServiceProvider.GetRequiredService<IClientScopeServiceProviderAccessor>().ServiceProvider.GetRequiredService<MvcCachedApplicationConfigurationClient>().InitializeAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
|