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); } }
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); } }