public async Task <IHttpActionResult> Posticd_chapters(icd_chapters icd_chapters) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.icd_chapters.Add(icd_chapters); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (icd_chaptersExists(icd_chapters.col1)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = icd_chapters.col1 }, icd_chapters)); }
public async Task <IHttpActionResult> Puticd_chapters(string id, icd_chapters icd_chapters) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != icd_chapters.col1) { return(BadRequest()); } db.Entry(icd_chapters).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!icd_chaptersExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Geticd_chapters(string id) { icd_chapters icd_chapters = await db.icd_chapters.FindAsync(id); if (icd_chapters == null) { return(NotFound()); } return(Ok(icd_chapters)); }
public async Task <IHttpActionResult> Deleteicd_chapters(string id) { icd_chapters icd_chapters = await db.icd_chapters.FindAsync(id); if (icd_chapters == null) { return(NotFound()); } db.icd_chapters.Remove(icd_chapters); await db.SaveChangesAsync(); return(Ok(icd_chapters)); }