protected AccountInfo ToAccountInfo(ContentUser muser) { if (muser == null) { return(null); } return(new AccountInfo() { UserName = muser.UserName, Email = muser.Email, CreationDate = muser.Created, Comment = muser.Comment, IsOnline = muser.IsOnline, LastLoginDate = muser.LastLoginDate, IsLockedOut = muser.IsLockedOut, LastLockoutDate = muser.LastLockoutDate.HasValue ? muser.LastLockoutDate.Value : DateTime.MinValue, IsApproved = muser.IsApproved }); }
private TUser FindUserByUserId(int userId) { var userList = Bridge.GetUserContainer(false); if (userList == null) { return(null); } // TUser: see review questions on upgrading old users return(Bridge.Repository.Find(Parameter.Equal("Parent", userList), /*Parameter.TypeEqual(typeof(TUser)),*/ ContentUser.UserIdQueryParameter(userId)) .Select(u => ToApplicationUser(u)).Where(u => (u != null)) .FirstOrDefault()); }