Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #614 from eldiosyeldiablo/master
Browse files Browse the repository at this point in the history
Adds case insensitive user search
  • Loading branch information
leastprivilege committed Mar 3, 2014
2 parents 4fac139 + a86ea87 commit 005c714
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ public IEnumerable<string> GetUsers(int pageIndex, int count, out int totalCount
public IEnumerable<string> GetUsers(string filter, int pageIndex, int count, out int totalCount)
{
var items = Membership.GetAllUsers().OfType<MembershipUser>();
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);
Expand Down

0 comments on commit 005c714

Please sign in to comment.