From 4fac1394adb04b15735b12e25c64001506fb0a17 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Thu, 27 Feb 2014 08:38:29 -0500 Subject: [PATCH] bug in paging semantics --- .../MembershipRebootUserRepository/IdentityRepository.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/MembershipRebootUserRepository/MembershipRebootUserRepository/IdentityRepository.cs b/samples/MembershipRebootUserRepository/MembershipRebootUserRepository/IdentityRepository.cs index 69c10ea5..f9be39e8 100644 --- a/samples/MembershipRebootUserRepository/MembershipRebootUserRepository/IdentityRepository.cs +++ b/samples/MembershipRebootUserRepository/MembershipRebootUserRepository/IdentityRepository.cs @@ -118,11 +118,17 @@ public IEnumerable GetRolesForUser(string userName) public IEnumerable GetUsers(int start, int count, out int totalCount) { + if (start < 1) start = 0; + if (count < 0) count = 10; + start = (start - 1) * count; return userQuery.Query(userSvc.Configuration.DefaultTenant, null, start, count, out totalCount).Select(x => x.Username); } public IEnumerable GetUsers(string filter, int start, int count, out int totalCount) { + if (start < 1) start = 1; + if (count < 0) count = 10; + start = (start - 1) * count; return userQuery.Query(userSvc.Configuration.DefaultTenant, filter, start, count, out totalCount).Select(x => x.Username); }