From a86ea877ea26899dc3bfd72002ee238e41d6d392 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 2 Mar 2014 23:15:33 -0500 Subject: [PATCH] Adds case insensitive user search --- .../ProviderUserManagementRepository.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ProviderUserManagementRepository.cs b/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ProviderUserManagementRepository.cs index 57c5208c..4a5c3a58 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ProviderUserManagementRepository.cs +++ b/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ProviderUserManagementRepository.cs @@ -80,10 +80,11 @@ public IEnumerable GetUsers(int pageIndex, int count, out int totalCount public IEnumerable GetUsers(string filter, int pageIndex, int count, out int totalCount) { var items = Membership.GetAllUsers().OfType(); + filter = filter.ToLower(); var query = from user in items - where user.UserName.Contains(filter) || - (user.Email != null && user.Email.Contains(filter)) + where user.UserName.ToLower().Contains(filter) || + (user.Email != null && user.Email.ToLower().Contains(filter)) select user.UserName; totalCount = query.Count(); return query.Skip(pageIndex * count).Take(count);