|
|
|
@ -54,10 +54,10 @@ namespace Volo.Abp.AspNetCore.Components |
|
|
|
protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); |
|
|
|
private ICurrentUser _currentUser; |
|
|
|
|
|
|
|
protected IUiMessageService Message => LazyGetRequiredService(ref _message); |
|
|
|
protected IUiMessageService Message => LazyGetNonScopedRequiredService(ref _message); |
|
|
|
private IUiMessageService _message; |
|
|
|
|
|
|
|
protected IUiNotificationService Notify => LazyGetRequiredService(ref _notify); |
|
|
|
protected IUiNotificationService Notify => LazyGetNonScopedRequiredService(ref _notify); |
|
|
|
private IUiNotificationService _notify; |
|
|
|
|
|
|
|
protected IObjectMapper ObjectMapper |
|
|
|
@ -97,6 +97,21 @@ namespace Volo.Abp.AspNetCore.Components |
|
|
|
return reference; |
|
|
|
} |
|
|
|
|
|
|
|
protected TService LazyGetNonScopedRequiredService<TService>(ref TService reference) => LazyGetNonScopedRequiredService(typeof(TService), ref reference); |
|
|
|
|
|
|
|
protected TRef LazyGetNonScopedRequiredService<TRef>(Type serviceType, ref TRef reference) |
|
|
|
{ |
|
|
|
if (reference == null) |
|
|
|
{ |
|
|
|
reference = (TRef)NonScopedServices.GetRequiredService(serviceType); |
|
|
|
} |
|
|
|
|
|
|
|
return reference; |
|
|
|
} |
|
|
|
|
|
|
|
[Inject] |
|
|
|
protected IServiceProvider NonScopedServices { get; set; } |
|
|
|
|
|
|
|
protected virtual IStringLocalizer CreateLocalizer() |
|
|
|
{ |
|
|
|
if (LocalizationResource != null) |
|
|
|
|