public IHttpActionResult PutTBLEVENTO(int id, TBLEVENTO tBLEVENTO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tBLEVENTO.id_evento) { return(BadRequest()); } db.Entry(tBLEVENTO).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TBLEVENTOExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTBLEVENTO(int id) { TBLEVENTO tBLEVENTO = db.TBLEVENTO.Find(id); if (tBLEVENTO == null) { return(NotFound()); } return(Ok(tBLEVENTO)); }
public IHttpActionResult PostTBLEVENTO(TBLEVENTO tBLEVENTO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TBLEVENTO.Add(tBLEVENTO); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = tBLEVENTO.id_evento }, tBLEVENTO)); }
public IHttpActionResult DeleteTBLEVENTO(int id) { TBLEVENTO tBLEVENTO = db.TBLEVENTO.Find(id); if (tBLEVENTO == null) { return(NotFound()); } db.TBLEVENTO.Remove(tBLEVENTO); db.SaveChanges(); return(Ok(tBLEVENTO)); }