public async Task <IActionResult> PutCar(int id, Car car) { if (id != car.CarId) { return(BadRequest()); } _context.Entry(car).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutConfig(Configuration config) { _context.Entry(config).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(NoContent()); }
public async Task <IActionResult> PutPerson(int id, Person person) { if (id != person.PersonId) { return(BadRequest()); } _context.Entry(person).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }