public async Task <IHttpActionResult> Posttbl_DTCTformat(tbl_DTCTformat tbl_DTCTformat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tbl_DTCTformat.Add(tbl_DTCTformat); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (tbl_DTCTformatExists(tbl_DTCTformat.bf_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tbl_DTCTformat.bf_id }, tbl_DTCTformat)); }
public async Task <IHttpActionResult> Puttbl_DTCTformat(string id, tbl_DTCTformat tbl_DTCTformat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_DTCTformat.bf_id) { return(BadRequest()); } db.Entry(tbl_DTCTformat).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tbl_DTCTformatExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Gettbl_DTCTformat(string id) { tbl_DTCTformat tbl_DTCTformat = await db.tbl_DTCTformat.FindAsync(id); if (tbl_DTCTformat == null) { return(NotFound()); } return(Ok(tbl_DTCTformat)); }
public async Task <IHttpActionResult> Deletetbl_DTCTformat(string id) { tbl_DTCTformat tbl_DTCTformat = await db.tbl_DTCTformat.FindAsync(id); if (tbl_DTCTformat == null) { return(NotFound()); } db.tbl_DTCTformat.Remove(tbl_DTCTformat); await db.SaveChangesAsync(); return(Ok(tbl_DTCTformat)); }