public IHttpActionResult PutDM_LyDoXuat(int id, DM_LyDoXuat dM_LyDoXuat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != dM_LyDoXuat.id) { return(BadRequest()); } db.Entry(dM_LyDoXuat).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DM_LyDoXuatExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetDM_LyDoXuat(int id) { DM_LyDoXuat dM_LyDoXuat = db.DM_LyDoXuat.Find(id); if (dM_LyDoXuat == null) { return(NotFound()); } return(Ok(dM_LyDoXuat)); }
public IHttpActionResult PostDM_LyDoXuat(DM_LyDoXuat dM_LyDoXuat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DM_LyDoXuat.Add(dM_LyDoXuat); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = dM_LyDoXuat.id }, dM_LyDoXuat)); }
public IHttpActionResult DeleteDM_LyDoXuat(int id) { DM_LyDoXuat dM_LyDoXuat = db.DM_LyDoXuat.Find(id); if (dM_LyDoXuat == null) { return(NotFound()); } db.DM_LyDoXuat.Remove(dM_LyDoXuat); db.SaveChanges(); return(Ok(dM_LyDoXuat)); }