public async Task <IActionResult> PutSobrepresion(int id, Sobrepresion Sobrepresion) { if (id != Sobrepresion.Id) { return(BadRequest()); } _context.Entry(Sobrepresion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SobrepresionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Sobrepresion> > PostSobrepresion(Sobrepresion Sobrepresion) { _context.Sobrepresion.Add(Sobrepresion); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (SobrepresionExists(Sobrepresion.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetSobrepresion", new { id = Sobrepresion.Id }, Sobrepresion)); }