public async Task <ActionResult <PlanGrupal> > PostPlanGrupal(PlanGrupal planGrupal) { _context.PlanGrupal.Add(planGrupal); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPlanGrupal", new { id = planGrupal.PlanGrupalId }, planGrupal)); }
public async Task <IActionResult> PutPlanGrupal([FromRoute] int id, [FromBody] PlanGrupal planGrupal) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != planGrupal.Id) { return(BadRequest()); } _context.Entry(planGrupal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlanGrupalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPlanGrupal(long id, PlanGrupal planGrupal) { if (id != planGrupal.PlanGrupalId) { return(BadRequest()); } _context.Entry(planGrupal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlanGrupalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPlanGrupal([FromBody] PlanGrupal planGrupal) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.PlanGrupal.Add(planGrupal); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPlanGrupal", new { id = planGrupal.Id }, planGrupal)); }