public IHttpActionResult PutNCC_LOAI_HANG_CUNG_CAP(int id, NCC_LOAI_HANG_CUNG_CAP nCC_LOAI_HANG_CUNG_CAP) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != nCC_LOAI_HANG_CUNG_CAP.ID) { return(BadRequest()); } db.Entry(nCC_LOAI_HANG_CUNG_CAP).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!NCC_LOAI_HANG_CUNG_CAPExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetNCC_LOAI_HANG_CUNG_CAP() { NCC_LOAI_HANG_CUNG_CAP nCC_LOAI_HANG_CUNG_CAP = db.NCC_LOAI_HANG_CUNG_CAP.Find(); if (nCC_LOAI_HANG_CUNG_CAP == null) { return(NotFound()); } return(Ok(nCC_LOAI_HANG_CUNG_CAP)); }
public IHttpActionResult PostNCC_LOAI_HANG_CUNG_CAP(NCC_LOAI_HANG_CUNG_CAP nCC_LOAI_HANG_CUNG_CAP) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.NCC_LOAI_HANG_CUNG_CAP.Add(nCC_LOAI_HANG_CUNG_CAP); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = nCC_LOAI_HANG_CUNG_CAP.ID }, nCC_LOAI_HANG_CUNG_CAP)); }
public IHttpActionResult DeleteNCC_LOAI_HANG_CUNG_CAP(int id) { NCC_LOAI_HANG_CUNG_CAP nCC_LOAI_HANG_CUNG_CAP = db.NCC_LOAI_HANG_CUNG_CAP.Find(id); if (nCC_LOAI_HANG_CUNG_CAP == null) { return(NotFound()); } db.NCC_LOAI_HANG_CUNG_CAP.Remove(nCC_LOAI_HANG_CUNG_CAP); db.SaveChanges(); return(Ok(nCC_LOAI_HANG_CUNG_CAP)); }