public Models.Login GetUser(LoginContext loginContext) { var existingUser = _authenticationContext.Logins.FirstOrDefault(user => user.Username.Equals(loginContext.username) && user.Password.Equals(loginContext.password)); if (existingUser != null) { return(existingUser); } return(null); }
public bool UserIsAuthorized(LoginContext loginContext) { return(_authenticationContext.Logins.Any(user => user.Username.Equals(loginContext.username) && user.Password.Equals(loginContext.password))); }