Browse Source

IIDentityClaimTypeRepository updated

pull/1735/head
Yunus Emre Kalkan 7 years ago
parent
commit
9e31797766
  1. 2
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs
  2. 10
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs
  3. 7
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs

2
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs

@ -17,6 +17,6 @@ namespace Volo.Abp.Identity
/// </param>
Task<bool> AnyAsync(string name, Guid? ignoredId = null);
Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount);
Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter);
}
}

10
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs

@ -24,9 +24,15 @@ namespace Volo.Abp.Identity.EntityFrameworkCore
.CountAsync(ct => ct.Name == name) > 0;
}
public async Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount)
public async Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter)
{
var identityClaimTypes = await DbSet.OrderBy(sorting ?? "name desc")
var identityClaimTypes = await DbSet
.WhereIf(
!filter.IsNullOrWhiteSpace(),
u =>
u.Name.Contains(filter)
)
.OrderBy(sorting ?? "name desc")
.PageBy(skipCount, maxResultCount)
.ToListAsync();

7
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs

@ -32,9 +32,14 @@ namespace Volo.Abp.Identity.MongoDB
}
}
public async Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount)
public async Task<List<IdentityClaimType>> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter)
{
return await GetMongoQueryable()
.WhereIf<IdentityClaimType, IMongoQueryable<IdentityClaimType>>(
!filter.IsNullOrWhiteSpace(),
u =>
u.Name.Contains(filter)
)
.OrderBy(sorting ?? nameof(IdentityClaimType.Name))
.As<IMongoQueryable<IdentityClaimType>>()
.PageBy<IdentityClaimType, IMongoQueryable<IdentityClaimType>>(skipCount, maxResultCount)

Loading…
Cancel
Save