Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/10 01:03:47 (14 years ago)
Author:
dkahn
Message:

#1061 Implemented GetAllUsers with unit test. Returning an ordered collection is still to be done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabMembershipProvider.cs

    r4005 r4006  
    125125      }
    126126    }
    127 
    128 
    129127
    130128    public override bool ChangePassword(string username, string oldPassword, string newPassword) {
     
    253251    }
    254252
    255     // not for production use - fab and dkhan are currently working on that
    256253    public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords) {
    257254      totalRecords = 0;
     
    266263
    267264        MembershipUserCollection userCollection = new MembershipUserCollection();
    268         int skip = (pageIndex == 0) ? 0 : (pageIndex * pageSize) - 1;
    269 
    270         var users = from u in db.HeuristicLabUsers select u;
    271 
    272         foreach (HeuristicLabUser u in users) {
    273 
    274           // this leads to a npe
    275           if (u != null) {
    276             userCollection.Add(u.getMembershipUser(this.Name));
    277           }
     265        int skip = (pageIndex == 0) ? 0 : (pageIndex * pageSize);
     266
     267        // .OrderBy(usr=>usr.UserName)
     268        // skipped ordering for now as the default comparator seems to be wrong
     269        foreach (HeuristicLabUser u in db.HeuristicLabUsers.Skip(skip).Take(pageSize)) {
     270          userCollection.Add(u.getMembershipUser(this.Name));
    278271        }
    279272        return userCollection;
Note: See TracChangeset for help on using the changeset viewer.