public async Task <IActionResult> PutAnimal(int id, Animal animal) { if (id != animal.AnimalId) { return(BadRequest()); } _context.Entry(animal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AnimalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPark(int id, Park park) { if (id != park.ParkId) { return(BadRequest()); } _context.Entry(park).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParkExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }