diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs index be11861574..36d28b7659 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore bool includeDetails = true, CancellationToken cancellationToken = default) { - return await DbSet + return await (await GetDbSetAsync()) .IncludeDetails(includeDetails) .FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken)); } @@ -50,7 +50,7 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore bool includeDetails = false, CancellationToken cancellationToken = default) { - return await DbSet + return await (await GetDbSetAsync()) .IncludeDetails(includeDetails) .WhereIf( !filter.IsNullOrWhiteSpace(), @@ -72,9 +72,15 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore ).CountAsync(cancellationToken: cancellationToken); } + [Obsolete("Use WithDetailsAsync method.")] public override IQueryable WithDetails() { return GetQueryable().IncludeDetails(); } + + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs index a074cd973a..abd03ab65d 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs @@ -13,18 +13,18 @@ namespace Volo.Abp.TenantManagement.MongoDB { public class MongoTenantRepository : MongoDbRepository, ITenantRepository { - public MongoTenantRepository(IMongoDbContextProvider dbContextProvider) + public MongoTenantRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) { } public virtual async Task FindByNameAsync( - string name, - bool includeDetails = true, + string name, + bool includeDetails = true, CancellationToken cancellationToken = default) { - return await GetMongoQueryable() + return await (await GetMongoQueryableAsync(cancellationToken)) .FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken)); } @@ -41,14 +41,14 @@ namespace Volo.Abp.TenantManagement.MongoDB } public virtual async Task> GetListAsync( - string sorting = null, - int maxResultCount = int.MaxValue, - int skipCount = 0, - string filter = null, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + string filter = null, bool includeDetails = false, CancellationToken cancellationToken = default) { - return await GetMongoQueryable() + return await (await GetMongoQueryableAsync(cancellationToken)) .WhereIf>( !filter.IsNullOrWhiteSpace(), u => @@ -62,7 +62,7 @@ namespace Volo.Abp.TenantManagement.MongoDB public virtual async Task GetCountAsync(string filter = null, CancellationToken cancellationToken = default) { - return await GetMongoQueryable() + return await (await GetMongoQueryableAsync(cancellationToken)) .WhereIf>( !filter.IsNullOrWhiteSpace(), u => @@ -70,4 +70,4 @@ namespace Volo.Abp.TenantManagement.MongoDB ).CountAsync(cancellationToken: cancellationToken); } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo/Abp/TenantManagement/TenantConnectionString_Tests.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo/Abp/TenantManagement/TenantConnectionString_Tests.cs index 24c27db8ae..c6c197ea70 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo/Abp/TenantManagement/TenantConnectionString_Tests.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.Domain.Tests/Volo/Abp/TenantManagement/TenantConnectionString_Tests.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.TenantManagement [Theory] [InlineData("aaa")] [InlineData("bbb")] - public async Task SetValue(string value) + public void SetValue(string value) { var tenantConnectionString = new TenantConnectionString(Guid.NewGuid(), "MyConnString", "MyConnString-Value");