public IHttpActionResult PostMA_RTF_ESC(MA_RTF_ESC mA_RTF_ESC) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MA_RTF_ESC.Add(mA_RTF_ESC); try { db.SaveChanges(); } catch (DbUpdateException) { if (MA_RTF_ESCExists(mA_RTF_ESC.cs_codigo_Rtf)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mA_RTF_ESC.cs_codigo_Rtf }, mA_RTF_ESC)); }
public IHttpActionResult PutMA_RTF_ESC(string id, MA_RTF_ESC mA_RTF_ESC) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mA_RTF_ESC.cs_codigo_Rtf) { return(BadRequest()); } db.Entry(mA_RTF_ESC).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MA_RTF_ESCExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetMA_RTF_ESC(string id) { MA_RTF_ESC mA_RTF_ESC = db.MA_RTF_ESC.Find(id); if (mA_RTF_ESC == null) { return(NotFound()); } return(Ok(mA_RTF_ESC)); }
public IHttpActionResult DeleteMA_RTF_ESC(string id) { MA_RTF_ESC mA_RTF_ESC = db.MA_RTF_ESC.Find(id); if (mA_RTF_ESC == null) { return(NotFound()); } db.MA_RTF_ESC.Remove(mA_RTF_ESC); db.SaveChanges(); return(Ok(mA_RTF_ESC)); }