public IHttpActionResult PutSedeXTEC(int id, SedeXTEC sedeXTEC) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sedeXTEC.IdSedeXTEC) { return(BadRequest()); } db.Entry(sedeXTEC).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!SedeXTECExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetSedeXTEC(int id) { SedeXTEC sedeXTEC = db.SedeXTECs.Find(id); if (sedeXTEC == null) { return(NotFound()); } return(Ok(sedeXTEC)); }
public IHttpActionResult PostSedeXTEC(SedeXTEC sedeXTEC) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.SedeXTECs.Add(sedeXTEC); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = sedeXTEC.IdSedeXTEC }, sedeXTEC)); }
public IHttpActionResult DeleteSedeXTEC(int id) { SedeXTEC sedeXTEC = db.SedeXTECs.Find(id); if (sedeXTEC == null) { return(NotFound()); } db.SedeXTECs.Remove(sedeXTEC); db.SaveChanges(); return(Ok(sedeXTEC)); }