예제 #1
0
        public User GetUserByCookies(string cookie)
        {
            using (PhoneStoreContext context = new PhoneStoreContext())
            {
                UserEntity userEntity = context.Users.FirstOrDefault(e => e.Cookie == cookie);

                return(userEntity != null?userEntity.ConvertToApplicationModel() : null);
            }
        }
예제 #2
0
        public User GetUser(Login login)
        {
            using (PhoneStoreContext context = new PhoneStoreContext())
            {
                UserEntity userEntity = context.Users.FirstOrDefault(e => e.Email == login.Email && e.Password == login.Password);

                return(userEntity != null?userEntity.ConvertToApplicationModel() : null);
            }
        }