diff --git a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs index 3b1d9054..3be19b6a 100644 --- a/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs +++ b/Yi.Abp.Net8/module/digital-collectibles/Yi.Framework.DigitalCollectibles.Application/Services/CollectiblesService.cs @@ -34,6 +34,11 @@ public class CollectiblesService : ApplicationService { return LazyServiceProvider.LazyGetRequiredService().GetValue("IsEnableCollectibles"); } + + public bool GetEnable2() + { + return LazyServiceProvider.LazyGetRequiredService().GetValue("IsEnableCollectibles2"); + } /// /// 获取该用户的信息 diff --git a/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs b/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs index f5bfaa52..8ada0992 100644 --- a/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs +++ b/Yi.Abp.Net8/module/tenant-management/Yi.Framework.TenantManagement.Domain/SqlSugarAndConfigurationTenantStore.cs @@ -6,6 +6,7 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy.ConfigurationStore; +using Volo.Abp.Uow; namespace Yi.Framework.TenantManagement.Domain { @@ -14,14 +15,16 @@ namespace Yi.Framework.TenantManagement.Domain private ISqlSugarTenantRepository TenantRepository { get; } protected ICurrentTenant CurrentTenant { get; } protected IDistributedCache Cache { get; } + private IUnitOfWorkManager _unitOfWorkManager; public SqlSugarAndConfigurationTenantStore(ISqlSugarTenantRepository repository, IDistributedCache cache, ICurrentTenant currentTenant, - IOptionsMonitor options) : base(options) + IOptionsMonitor options, IUnitOfWorkManager unitOfWorkManager) : base(options) { TenantRepository = repository; Cache = cache; CurrentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; } public new TenantConfiguration? Find(string name) @@ -79,7 +82,13 @@ namespace Yi.Framework.TenantManagement.Domain { using (CurrentTenant.Change(null)) //TODO: No need this if we can implement to define host side (or tenant-independent) entities! { - var tenant = await TenantRepository.FindAsync(id.Value); + TenantAggregateRoot tenant = null; + using (var uow=_unitOfWorkManager.Begin(isTransactional:false)) + { + tenant = await TenantRepository.FindAsync(id.Value); + await uow.CompleteAsync(); + } + return await SetCacheAsync(cacheKey, tenant); } }