public async Task <ActionResult <Models.CarePlan> > PostCarePlan(Models.CarePlan carePlan) { _context.CarePlan.Add(carePlan); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCarePlan", new { id = carePlan.CarePlanId }, carePlan)); }
public async Task <IActionResult> PutCarePlan(int id, Models.CarePlan carePlan) { if (id != carePlan.CarePlanId) { return(BadRequest()); } _context.Entry(carePlan).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarePlanExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }