public IHttpActionResult PutCATELOGY(int id, CATELOGY cATELOGY) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cATELOGY.CATE_ID) { return(BadRequest()); } db.Entry(cATELOGY).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CATELOGYExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCATELOGY(int id) { CATELOGY cATELOGY = db.CATELOGies.Find(id); if (cATELOGY == null) { return(NotFound()); } return(Ok(cATELOGY)); }
public IHttpActionResult PostCATELOGY(CATELOGY cATELOGY) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CATELOGies.Add(cATELOGY); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = cATELOGY.CATE_ID }, cATELOGY)); }
public IHttpActionResult DeleteCATELOGY(int id) { CATELOGY cATELOGY = db.CATELOGies.Find(id); if (cATELOGY == null) { return(NotFound()); } db.CATELOGies.Remove(cATELOGY); db.SaveChanges(); return(Ok(cATELOGY)); }