public async Task <IHttpActionResult> PutCAT_COLOR(short id, CAT_COLOR cAT_COLOR) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cAT_COLOR.id) { return(BadRequest()); } db.Entry(cAT_COLOR).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CAT_COLORExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetCAT_COLOR(short id) { CAT_COLOR cAT_COLOR = await db.CAT_COLOR.FindAsync(id); if (cAT_COLOR == null) { return(NotFound()); } return(Ok(cAT_COLOR)); }
public async Task <IHttpActionResult> PostCAT_COLOR(CAT_COLOR cAT_COLOR) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CAT_COLOR.Add(cAT_COLOR); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = cAT_COLOR.id }, cAT_COLOR)); }
public async Task <IHttpActionResult> DeleteCAT_COLOR(short id) { CAT_COLOR cAT_COLOR = await db.CAT_COLOR.FindAsync(id); if (cAT_COLOR == null) { return(NotFound()); } db.CAT_COLOR.Remove(cAT_COLOR); await db.SaveChangesAsync(); return(Ok(cAT_COLOR)); }