public IHttpActionResult PostMA_CONFIG_LIBRO(MA_CONFIG_LIBRO mA_CONFIG_LIBRO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_CONFIG_LIBRO.Add(mA_CONFIG_LIBRO); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_CONFIG_LIBROExists(mA_CONFIG_LIBRO.CS_CAMPO)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_CONFIG_LIBRO.CS_CAMPO }, mA_CONFIG_LIBRO)); }
public IHttpActionResult PutMA_CONFIG_LIBRO(string id, MA_CONFIG_LIBRO mA_CONFIG_LIBRO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_CONFIG_LIBRO.CS_CAMPO) { return(BadRequest()); } db.Entry(mA_CONFIG_LIBRO).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_CONFIG_LIBROExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_CONFIG_LIBRO(string id) { MA_CONFIG_LIBRO mA_CONFIG_LIBRO = db.MA_CONFIG_LIBRO.Find(id); if (mA_CONFIG_LIBRO == null) { return(NotFound()); } return(Ok(mA_CONFIG_LIBRO)); }
public IHttpActionResult DeleteMA_CONFIG_LIBRO(string id) { MA_CONFIG_LIBRO mA_CONFIG_LIBRO = db.MA_CONFIG_LIBRO.Find(id); if (mA_CONFIG_LIBRO == null) { return(NotFound()); } db.MA_CONFIG_LIBRO.Remove(mA_CONFIG_LIBRO); db.SaveChanges(); return(Ok(mA_CONFIG_LIBRO)); }