public async Task <IHttpActionResult> PutAccount(int id, Account account) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != account.Id) { return(BadRequest()); } db.Entry(account).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccountExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task SaveChanges() { await _dbContext.SaveChangesAsync(); }