public IHttpActionResult PutCYCCycleMST(long id, CYCCycleMST cYCCycleMST) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cYCCycleMST.CYCCycleMSTId) { return(BadRequest()); } db.Entry(cYCCycleMST).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CYCCycleMSTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCYCCycleMST(long id) { CYCCycleMST cYCCycleMST = db.CYCCycleMSTs.Find(id); if (cYCCycleMST == null) { return(NotFound()); } return(Ok(cYCCycleMST)); }
public IHttpActionResult PostCYCCycleMST(CYCCycleMST cYCCycleMST) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CYCCycleMSTs.Add(cYCCycleMST); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = cYCCycleMST.CYCCycleMSTId }, cYCCycleMST)); }
public IHttpActionResult DeleteCYCCycleMST(long id) { CYCCycleMST cYCCycleMST = db.CYCCycleMSTs.Find(id); if (cYCCycleMST == null) { return(NotFound()); } db.CYCCycleMSTs.Remove(cYCCycleMST); db.SaveChanges(); return(Ok(cYCCycleMST)); }