Esempio n. 1
0
        // Inherited from MembershipProvider ==> Forwarded to previous provider if this provider hasn't been initialized
        public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            if (!InitializeCalled)
            {
                return(PreviousProvider.GetAllUsers(pageIndex, pageSize, out totalRecords));
            }
            var collection = new MembershipUserCollection();

            foreach (var user in
                     _session.Users
                     .Skip(pageIndex * pageSize)
                     .Take(pageSize).Select(u =>
                                            new MembershipUser(
                                                this.Name,
                                                u.UserName,
                                                u.UserId,
                                                null,
                                                null,
                                                null,
                                                u.IsConfirmed,
                                                false,
                                                u.CreateDate.Value,
                                                u.LastLoginDate.HasValue ? u.LastLoginDate.Value : DateTime.MinValue,
                                                u.LastLoginDate.HasValue ? u.LastLoginDate.Value : DateTime.MinValue,
                                                u.PasswordChangedDate.HasValue ? u.PasswordChangedDate.Value : DateTime.MinValue,
                                                DateTime.MinValue)))
            {
                collection.Add(user);
            }
            totalRecords = _session.Users.Count();
            return(collection);
        }
Esempio n. 2
0
 // Inherited from MembershipProvider ==> Forwarded to previous provider if this provider hasn't been initialized
 public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
 {
     if (!InitializeCalled)
     {
         return(PreviousProvider.GetAllUsers(pageIndex, pageSize, out totalRecords));
     }
     throw new NotSupportedException();
 }