public async Task <IActionResult> PutFish(int id, Fish fish) { if (id != fish.FishId) { return(BadRequest()); } _context.Entry(fish).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FishExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTank(int id, Tank tank) { if (id != tank.TankId) { return(BadRequest()); } _context.Entry(tank).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TankExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }