Browse Source

Remove ITenantRepository.GetCountAsync which is already exists in the base interface.

pull/856/head
Halil ibrahim Kalkan 8 years ago
parent
commit
a1dcd4f974
  1. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs
  2. 5
      modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs
  3. 5
      modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs
  4. 7
      modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/TenantRepository_Tests.cs

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/ITenantRepository.cs

@ -20,7 +20,5 @@ namespace Volo.Abp.TenantManagement
string filter = null, string filter = null,
bool includeDetails = false, bool includeDetails = false,
CancellationToken cancellationToken = default); CancellationToken cancellationToken = default);
Task<long> GetCountAsync(CancellationToken cancellationToken = default);
} }
} }

5
modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs

@ -48,11 +48,6 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore
.ToListAsync(cancellationToken); .ToListAsync(cancellationToken);
} }
public virtual async Task<long> GetCountAsync(CancellationToken cancellationToken = default)
{
return await DbSet.LongCountAsync(cancellationToken);
}
public override IQueryable<Tenant> WithDetails() public override IQueryable<Tenant> WithDetails()
{ {
return GetQueryable().IncludeDetails(); return GetQueryable().IncludeDetails();

5
modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs

@ -28,11 +28,6 @@ namespace Volo.Abp.TenantManagement.MongoDb
.FirstOrDefaultAsync(t => t.Name == name, cancellationToken); .FirstOrDefaultAsync(t => t.Name == name, cancellationToken);
} }
public virtual async Task<long> GetCountAsync(CancellationToken cancellationToken = default)
{
return await GetMongoQueryable().LongCountAsync(cancellationToken);
}
public virtual async Task<List<Tenant>> GetListAsync( public virtual async Task<List<Tenant>> GetListAsync(
string sorting = null, string sorting = null,
int maxResultCount = int.MaxValue, int maxResultCount = int.MaxValue,

7
modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/TenantRepository_Tests.cs

@ -3,7 +3,6 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Shouldly; using Shouldly;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Uow;
using Xunit; using Xunit;
namespace Volo.Abp.TenantManagement namespace Volo.Abp.TenantManagement
@ -48,12 +47,6 @@ namespace Volo.Abp.TenantManagement
tenant.ConnectionStrings.Count.ShouldBeGreaterThanOrEqualTo(2); tenant.ConnectionStrings.Count.ShouldBeGreaterThanOrEqualTo(2);
} }
[Fact]
public async Task GetCountAsync()
{
(await TenantRepository.GetCountAsync()).ShouldBeGreaterThan(0);
}
[Fact] [Fact]
public async Task GetListAsync() public async Task GetListAsync()
{ {

Loading…
Cancel
Save