public async Task <IActionResult> PutLongTermGoalsModel(int id, LongTermGoalsModel longTermGoalsModel) { if (id != longTermGoalsModel.ID) { return(BadRequest()); } _context.Entry(longTermGoalsModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LongTermGoalsModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <LongTermGoalsModel> > PostLongTermGoalsModel(LongTermGoalsModel longTermGoalsModel) { _context.LongTermGoalsModel.Add(longTermGoalsModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLongTermGoalsModel", new { id = longTermGoalsModel.ID }, longTermGoalsModel)); }