From 9e31797766f1f8686fd37862fcebe6d1b5e1f204 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 9 Sep 2019 09:59:16 +0300 Subject: [PATCH] IIDentityClaimTypeRepository updated --- .../Volo/Abp/Identity/IIDentityClaimTypeRepository.cs | 2 +- .../EfCoreIdentityClaimTypeRepository.cs | 10 ++++++++-- .../MongoDB/MongoIdentityClaimTypeRepository.cs | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs index c2d5b4fd5c..0e952bded9 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIDentityClaimTypeRepository.cs @@ -17,6 +17,6 @@ namespace Volo.Abp.Identity /// Task AnyAsync(string name, Guid? ignoredId = null); - Task> GetListAsync(string sorting, int maxResultCount, int skipCount); + Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter); } } diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs index 50a4578cae..95b7a7fe42 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentityClaimTypeRepository.cs +++ b/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> GetListAsync(string sorting, int maxResultCount, int skipCount) + public async Task> 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(); diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs index c2bbd56a6d..16ba528412 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentityClaimTypeRepository.cs +++ b/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> GetListAsync(string sorting, int maxResultCount, int skipCount) + public async Task> GetListAsync(string sorting, int maxResultCount, int skipCount, string filter) { return await GetMongoQueryable() + .WhereIf>( + !filter.IsNullOrWhiteSpace(), + u => + u.Name.Contains(filter) + ) .OrderBy(sorting ?? nameof(IdentityClaimType.Name)) .As>() .PageBy>(skipCount, maxResultCount)