IIDentityClaimTypeRepository updated

pull/1735/head
Yunus Emre Kalkan 6 years ago
parent f0aadae4f6
commit 9e31797766

@ -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);
}
}

@ -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();

@ -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