public async Task <IActionResult> Login(AccountViewModel account) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Account userToVerify = await Task.FromResult(_context.Get(account.Username)); if (userToVerify != null && userToVerify.PssWord == account.Password) { return(new OkObjectResult("You have been logged in.")); } return(NotFound()); }
public async Task <ActionResult <IEnumerable <Account> > > getAccounts() { return(await Task.FromResult(_context.Get())); }