public ActionResult <IEnumerable <stp.data.DTOs.UserAccount> > Get() { var userAccounts = new stp.data.Repository(_connection).GetAllUserAccounts().ToList(); if (!userAccounts.Any()) { return(NoContent()); } return(userAccounts.ToArray()); }
public ActionResult Authenticate([FromBody] DTOs.UserCredentials userCredentials) { var userAccount = new stp.data.Repository(_connection).FindUserAccountByUsernameAndPassword(userCredentials.Username, userCredentials.Password); if (userAccount == null) { return(BadRequest(new { message = "Incorrect username and/or password." })); } return(Ok()); }