public async Task <IActionResult> PutToilet(long id, Toilet toilet) { if (id != toilet.Id) { return(BadRequest()); } _context.Entry(toilet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ToiletExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFestival(long id, Festival festival) { if (id != festival.Id) { return(BadRequest()); } _context.Entry(festival).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FestivalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }