public async Task <IHttpActionResult> PutCPGFD_KB(int id, CPGFD_KB cPGFD_KB) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cPGFD_KB.ID) { return(BadRequest()); } db.Entry(cPGFD_KB).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CPGFD_KBExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetCPGFD_KB(int id) { CPGFD_KB cPGFD_KB = await db.CPGFD_KB.FindAsync(id); if (cPGFD_KB == null) { return(NotFound()); } return(Ok(cPGFD_KB)); }
public async Task <IHttpActionResult> PostCPGFD_KB(CPGFD_KB cPGFD_KB) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CPGFD_KB.Add(cPGFD_KB); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = cPGFD_KB.ID }, cPGFD_KB)); }
public async Task <IHttpActionResult> DeleteCPGFD_KB(int id) { CPGFD_KB cPGFD_KB = await db.CPGFD_KB.FindAsync(id); if (cPGFD_KB == null) { return(NotFound()); } db.CPGFD_KB.Remove(cPGFD_KB); await db.SaveChangesAsync(); return(Ok(cPGFD_KB)); }