public async Task <IActionResult> PutGrupoReto(int id, GrupoReto grupoReto) { if (id != grupoReto.idgrupo) { return(BadRequest()); } _context.Entry(grupoReto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GrupoRetoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <GrupoReto> > PostGrupoReto(GrupoReto grupoReto) { _context.GrupoReto.Add(grupoReto); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (GrupoRetoExists(grupoReto.idgrupo)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetGrupoReto", new { id = grupoReto.idgrupo }, grupoReto)); }