public async Task <IActionResult> PutPlant(int id, Plant plant) { if (id != plant.PlantId) { return(BadRequest()); } _context.Entry(plant).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlantExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFamily(int id, Family family) { if (id != family.FamilyId) { return(BadRequest()); } _context.Entry(family).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FamilyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCare(int id, Care care) { if (id != care.CareId) { return(BadRequest()); } _context.Entry(care).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CareExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }