- Timestamp:
- 07/07/10 02:20:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/Service/Provider/HeuristicLabMembershipProvider.cs
r4007 r4008 242 242 243 243 244 244 /// <summary> 245 /// Returns a paged collection of users that match a given e-mail address 246 /// TODO: Return a sorted result set 247 /// </summary> 248 /// <param name="emailToMatch"></param> 249 /// <param name="pageIndex"></param> 250 /// <param name="pageSize"></param> 251 /// <param name="totalRecords"></param> 252 /// <returns></returns> 245 253 public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords) { 246 throw new NotImplementedException(); 247 totalRecords = 0; 248 using (DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext()) { 249 // don't test db - throw an exception instead if something wents wrong 250 // bail out if there are no records 251 if (0 == (totalRecords = db.HeuristicLabUsers.Count<HeuristicLabUser>())) return new MembershipUserCollection(); 252 253 MembershipUserCollection userCollection = new MembershipUserCollection(); 254 255 } 256 } 257 258 254 using (DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext()) { 255 IQueryable<HeuristicLabUser> users = (from u in db.HeuristicLabUsers where u.Email == emailToMatch select u); 256 return PagedCollection(users, pageIndex, pageSize, out totalRecords); 257 } 258 } 259 260 /// <summary> 261 /// Returns a paged collection of users that match a given username 262 /// TODO: Return a sorted result set 263 /// </summary> 264 /// <param name="usernameToMatch"></param> 265 /// <param name="pageIndex"></param> 266 /// <param name="pageSize"></param> 267 /// <param name="totalRecords"></param> 268 /// <returns></returns> 259 269 public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords) { 260 throw new NotImplementedException(); 261 } 262 270 using (DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext()) { 271 IQueryable<HeuristicLabUser> users = (from u in db.HeuristicLabUsers where u.UserName == usernameToMatch select u); 272 return PagedCollection(users, pageIndex, pageSize, out totalRecords); 273 } 274 275 } 276 277 /// <summary> 278 /// Returns a paged collection of all users 279 /// TODO: Return a sorted result set 280 /// </summary> 281 /// <param name="pageIndex"></param> 282 /// <param name="pageSize"></param> 283 /// <param name="totalRecords"></param> 284 /// <returns></returns> 263 285 public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords) { 264 286 using (DataClassesDataContext db = DatabaseUtil.createDataClassesDataContext()) { … … 268 290 return PagedCollection(users, pageIndex, pageSize, out totalRecords); 269 291 } 292 270 293 } 271 294
Note: See TracChangeset
for help on using the changeset viewer.