diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs index db7b9041b76..4303c698fed 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/RazorPages/AbpPageModel.cs @@ -28,7 +28,7 @@ public abstract class AbpPageModel : PageModel protected TService LazyGetRequiredService(ref TService reference) => LazyGetRequiredService(typeof(TService), ref reference); - + protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference) { if (reference == null) @@ -45,16 +45,16 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference return reference; } - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; - public AlertList Alerts => AlertManager.Alerts; + protected AlertList Alerts => AlertManager.Alerts; - public IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); + protected IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); private IUnitOfWorkManager _unitOfWorkManager; protected Type ObjectMapperContext { get; set; } - public IObjectMapper ObjectMapper + protected IObjectMapper ObjectMapper { get { @@ -76,16 +76,16 @@ ref _objectMapper } private IObjectMapper _objectMapper; - public IGuidGenerator GuidGenerator => LazyGetRequiredService(ref _guidGenerator); + protected IGuidGenerator GuidGenerator => LazyGetRequiredService(ref _guidGenerator); private IGuidGenerator _guidGenerator; - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; - public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); private IStringLocalizerFactory _stringLocalizerFactory; - public IStringLocalizer L + protected IStringLocalizer L { get { @@ -102,22 +102,22 @@ public IStringLocalizer L protected Type LocalizationResourceType { get; set; } - public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; - public ISettingProvider SettingProvider => LazyGetRequiredService(ref _settingProvider); + protected ISettingProvider SettingProvider => LazyGetRequiredService(ref _settingProvider); private ISettingProvider _settingProvider; - public IModelStateValidator ModelValidator => LazyGetRequiredService(ref _modelValidator); + protected IModelStateValidator ModelValidator => LazyGetRequiredService(ref _modelValidator); private IModelStateValidator _modelValidator; - public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); private IAuthorizationService _authorizationService; - public IAlertManager AlertManager => LazyGetRequiredService(ref _alertManager); + protected IAlertManager AlertManager => LazyGetRequiredService(ref _alertManager); private IAlertManager _alertManager; protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs index 52f01e0b2ce..645e13b0267 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs @@ -43,11 +43,11 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference return reference; } - public IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); + protected IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); private IUnitOfWorkManager _unitOfWorkManager; protected Type ObjectMapperContext { get; set; } - public IObjectMapper ObjectMapper + protected IObjectMapper ObjectMapper { get { @@ -69,39 +69,39 @@ ref _objectMapper } private IObjectMapper _objectMapper; - public IGuidGenerator GuidGenerator => LazyGetRequiredService(ref _guidGenerator); + protected IGuidGenerator GuidGenerator => LazyGetRequiredService(ref _guidGenerator); private IGuidGenerator _guidGenerator; - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; protected ILogger Logger => _lazyLogger.Value; private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; - public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); private IAuthorizationService _authorizationService; protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current; - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; - public IModelStateValidator ModelValidator => LazyGetRequiredService(ref _modelValidator); + protected IModelStateValidator ModelValidator => LazyGetRequiredService(ref _modelValidator); private IModelStateValidator _modelValidator; - public IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); + protected IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); private IFeatureChecker _featureChecker; - public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); private IStringLocalizerFactory _stringLocalizerFactory; - public IStringLocalizer L + protected IStringLocalizer L { get { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs index e29cb5fbefd..2c0e38c13c4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpViewComponent.cs @@ -30,7 +30,7 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference } protected Type ObjectMapperContext { get; set; } - public IObjectMapper ObjectMapper + protected IObjectMapper ObjectMapper { get { diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs index 0a58adf0986..4e23a4cb410 100644 --- a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs @@ -36,28 +36,28 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference return reference; } - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; protected ILogger Logger => _lazyLogger.Value; private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; - public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); private IAuthorizationService _authorizationService; - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; - public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); private IStringLocalizerFactory _stringLocalizerFactory; - public IStringLocalizer L + protected IStringLocalizer L { get { @@ -99,7 +99,7 @@ protected virtual IStringLocalizer CreateLocalizer() } } - public abstract class AbpHub : Hub + public abstract class AbpHub : Hub where T : class { public IServiceProvider ServiceProvider { get; set; } @@ -124,28 +124,28 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference return reference; } - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; protected ILogger Logger => _lazyLogger.Value; private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; - public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); private IAuthorizationService _authorizationService; - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; - public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); private IStringLocalizerFactory _stringLocalizerFactory; - public IStringLocalizer L + protected IStringLocalizer L { get { diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerBase.cs index 3326c4e65fe..bf654cf6a71 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerBase.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/BackgroundWorkerBase.cs @@ -35,7 +35,7 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference return reference; } - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; protected ILogger Logger => _lazyLogger.Value; @@ -58,4 +58,4 @@ public override string ToString() return GetType().FullName; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs index 552aae426d5..df0aa25f0dc 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs @@ -57,11 +57,11 @@ protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference public List AppliedCrossCuttingConcerns { get; } = new List(); - public IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); + protected IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); private IUnitOfWorkManager _unitOfWorkManager; protected Type ObjectMapperContext { get; set; } - public IObjectMapper ObjectMapper + protected IObjectMapper ObjectMapper { get { @@ -85,31 +85,31 @@ ref _objectMapper public IGuidGenerator GuidGenerator { get; set; } - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; - public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; - public ISettingProvider SettingProvider => LazyGetRequiredService(ref _settingProvider); + protected ISettingProvider SettingProvider => LazyGetRequiredService(ref _settingProvider); private ISettingProvider _settingProvider; - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; - public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); private IAuthorizationService _authorizationService; - public IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); + protected IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); private IFeatureChecker _featureChecker; - public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); private IStringLocalizerFactory _stringLocalizerFactory; - public IStringLocalizer L + protected IStringLocalizer L { get { @@ -175,4 +175,4 @@ protected virtual IStringLocalizer CreateLocalizer() return localizer; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs index 14e8a64131b..36cade51be5 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs @@ -28,23 +28,23 @@ protected TService LazyGetRequiredService(ref TService reference) return reference; } - public IClock Clock => LazyGetRequiredService(ref _clock); + protected IClock Clock => LazyGetRequiredService(ref _clock); private IClock _clock; public IGuidGenerator GuidGenerator { get; set; } - public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; - - public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + + protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); private ICurrentTenant _currentTenant; protected ILogger Logger => _lazyLogger.Value; private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - + protected DomainService() { GuidGenerator = SimpleGuidGenerator.Instance; } } -} \ No newline at end of file +}