public async Task <IActionResult> PutEjemplo([FromRoute] int id, [FromBody] Ejemplo ejemplo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ejemplo.Id) { return(BadRequest()); } db.Entry(ejemplo).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EjemploExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutDependencia([FromRoute] int id, [FromBody] Dependencia dependencia) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != dependencia.IdDependencia) { return(BadRequest()); } db.Entry(dependencia).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(NoContent()); }
public async Task <IActionResult> PutIndiceOcupacional([FromRoute] int id, [FromBody] IndiceOcupacional indiceOcupacional) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != indiceOcupacional.IdIndiceOcupacional) { return(BadRequest()); } db.Entry(indiceOcupacional).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IndiceOcupacionalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAccionPersonal([FromRoute] int id, [FromBody] AccionPersonal accionPersonal) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != accionPersonal.IdAccionPersonal) { return(BadRequest()); } _context.Entry(accionPersonal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccionPersonalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }