public override MembershipUser GetUser(string username, bool userIsOnline)
 {
     using (AuthenticationDB dbContext = new AuthenticationDB())
     {
         var user = dbContext.Users.Where(us => string.Compare(username, us.Username, StringComparison.OrdinalIgnoreCase) == 0)
                    .Select(us => us).FirstOrDefault();
         if (user == null)
         {
             return(null);
         }
         var selectedUser = new CustomMembershipUser(user);
         return(selectedUser);
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="username"></param>
        /// <param name="userIsOnline"></param>
        /// <returns></returns>
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            using (DataBaseContext dbContext = new DataBaseContext())
            {
                var user = (from us in dbContext.Users
                            where string.Compare(username, us.Email, StringComparison.OrdinalIgnoreCase) == 0
                            select us).FirstOrDefault();

                if (user == null)
                {
                    return(null);
                }
                var selectedUser = new CustomMembershipUser(user);

                return(selectedUser);
            }
        }