public async Task <IHttpActionResult> Posttbl_DTCTVARIANT(tbl_DTCTVARIANT tbl_DTCTVARIANT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tbl_DTCTVARIANT.Add(tbl_DTCTVARIANT); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (tbl_DTCTVARIANTExists(tbl_DTCTVARIANT.va_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = tbl_DTCTVARIANT.va_id }, tbl_DTCTVARIANT)); }
public async Task <IHttpActionResult> Puttbl_DTCTVARIANT(string id, tbl_DTCTVARIANT tbl_DTCTVARIANT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_DTCTVARIANT.va_id) { return(BadRequest()); } db.Entry(tbl_DTCTVARIANT).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tbl_DTCTVARIANTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Gettbl_DTCTVARIANT(string id) { tbl_DTCTVARIANT tbl_DTCTVARIANT = await db.tbl_DTCTVARIANT.FindAsync(id); if (tbl_DTCTVARIANT == null) { return(NotFound()); } return(Ok(tbl_DTCTVARIANT)); }
public async Task <IHttpActionResult> Deletetbl_DTCTVARIANT(string id) { tbl_DTCTVARIANT tbl_DTCTVARIANT = await db.tbl_DTCTVARIANT.FindAsync(id); if (tbl_DTCTVARIANT == null) { return(NotFound()); } db.tbl_DTCTVARIANT.Remove(tbl_DTCTVARIANT); await db.SaveChangesAsync(); return(Ok(tbl_DTCTVARIANT)); }