예제 #1
0
        public BASE_USER Login(string email, string password)
        {
            string hashedPass = HashPassword.HashPass(password);

            using (SPORT_LINK_DBDataContext db = new SPORT_LINK_DBDataContext())
            {
                try
                {
                    return(db.USERs.Where(pe => pe.Email == email && pe.Password == hashedPass).Select(pe => new BASE_USER
                    {
                        ID = pe.UserId,
                        Name = pe.Name,
                        Email = pe.Email,
                        Surname = pe.Surname,
                        Pass = pe.Password,
                        Level = pe.Level
                    }).First());
                }
                catch
                {
                    return(null);
                }
            };
        }