removed unnecessary
This commit is contained in:
parent
4dcd9be041
commit
ff8e3c38e9
@ -134,42 +134,6 @@ public class UserServiceCache
|
||||
}
|
||||
}
|
||||
|
||||
[Scope]
|
||||
class ConfigureCachedUserService : IConfigureNamedOptions<CachedUserService>
|
||||
{
|
||||
internal readonly IOptionsSnapshot<EFUserService> Service;
|
||||
internal readonly UserServiceCache UserServiceCache;
|
||||
internal readonly CoreBaseSettings CoreBaseSettings;
|
||||
|
||||
public ConfigureCachedUserService(
|
||||
IOptionsSnapshot<EFUserService> service,
|
||||
UserServiceCache userServiceCache,
|
||||
CoreBaseSettings coreBaseSettings)
|
||||
{
|
||||
Service = service;
|
||||
UserServiceCache = userServiceCache;
|
||||
CoreBaseSettings = coreBaseSettings;
|
||||
}
|
||||
|
||||
public void Configure(string name, CachedUserService options)
|
||||
{
|
||||
Configure(options);
|
||||
options.Service = Service.Get(name);
|
||||
}
|
||||
|
||||
public void Configure(CachedUserService options)
|
||||
{
|
||||
options.Service = Service.Value;
|
||||
options.CoreBaseSettings = CoreBaseSettings;
|
||||
options.UserServiceCache = UserServiceCache;
|
||||
options.Cache = UserServiceCache.Cache;
|
||||
options.CacheUserInfoItem = UserServiceCache.CacheUserInfoItem;
|
||||
options.CacheUserPhotoItem = UserServiceCache.CacheUserPhotoItem;
|
||||
options.CacheGroupCacheItem = UserServiceCache.CacheGroupCacheItem;
|
||||
options.CacheUserGroupRefItem = UserServiceCache.CacheUserGroupRefItem;
|
||||
}
|
||||
}
|
||||
|
||||
[Scope]
|
||||
public class CachedUserService : IUserService, ICachedService
|
||||
{
|
||||
|
@ -66,38 +66,7 @@ public class CoreBaseSettings
|
||||
public bool DisableDocSpace => _disableDocSpace ?? (bool)(_disableDocSpace = string.Equals(Configuration["core:disableDocspace"], "true", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
class ConfigureCoreSettings : IConfigureNamedOptions<CoreSettings>
|
||||
{
|
||||
private readonly IOptionsSnapshot<CachedTenantService> _tenantService;
|
||||
private readonly CoreBaseSettings _coreBaseSettings;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public ConfigureCoreSettings(
|
||||
IOptionsSnapshot<CachedTenantService> tenantService,
|
||||
CoreBaseSettings coreBaseSettings,
|
||||
IConfiguration configuration
|
||||
)
|
||||
{
|
||||
_tenantService = tenantService;
|
||||
_coreBaseSettings = coreBaseSettings;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public void Configure(string name, CoreSettings options)
|
||||
{
|
||||
Configure(options);
|
||||
options.TenantService = _tenantService.Get(name);
|
||||
}
|
||||
|
||||
public void Configure(CoreSettings options)
|
||||
{
|
||||
options.Configuration = _configuration;
|
||||
options.CoreBaseSettings = _coreBaseSettings;
|
||||
options.TenantService = _tenantService.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[Scope(typeof(ConfigureCoreSettings))]
|
||||
[Scope]
|
||||
public class CoreSettings
|
||||
{
|
||||
public string BaseDomain
|
||||
|
@ -27,34 +27,6 @@
|
||||
namespace ASC.Core.Tenants;
|
||||
|
||||
[Scope]
|
||||
class ConfigureTenantUtil : IConfigureNamedOptions<TenantUtil>
|
||||
{
|
||||
private readonly IOptionsSnapshot<TenantManager> _tenantManager;
|
||||
private readonly TimeZoneConverter _timeZoneConverter;
|
||||
|
||||
public ConfigureTenantUtil(
|
||||
IOptionsSnapshot<TenantManager> tenantManager,
|
||||
TimeZoneConverter timeZoneConverter
|
||||
)
|
||||
{
|
||||
_tenantManager = tenantManager;
|
||||
_timeZoneConverter = timeZoneConverter;
|
||||
}
|
||||
|
||||
public void Configure(string name, TenantUtil options)
|
||||
{
|
||||
Configure(options);
|
||||
options._tenantManager = _tenantManager.Get(name);
|
||||
}
|
||||
|
||||
public void Configure(TenantUtil options)
|
||||
{
|
||||
options._timeZoneConverter = _timeZoneConverter;
|
||||
options._tenantManager = _tenantManager.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[Scope(typeof(ConfigureTenantUtil))]
|
||||
public class TenantUtil
|
||||
{
|
||||
internal TenantManager _tenantManager;
|
||||
|
Loading…
Reference in New Issue
Block a user