public async Task <ActionResult> UpdateCustomer(Customer customer) { if (ModelState.IsValid) { // using (var context = new PosContext()) { context.Attach <Customer>(customer).State = EntityState.Modified; await context.SaveChangesAsync(); return(NoContent()); } } return(BadRequest(ModelState)); }