public IHttpActionResult Puttbl_Options(long id, tbl_Options tbl_Options) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_Options.OptionID) { return(BadRequest()); } db.Entry(tbl_Options).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tbl_OptionsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Gettbl_Options(long id) { tbl_Options tbl_Options = db.tbl_Options.Find(id); if (tbl_Options == null) { return(NotFound()); } return(Ok(tbl_Options)); }
public IHttpActionResult Posttbl_Options(tbl_Options tbl_Options) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tbl_Options.Add(tbl_Options); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = tbl_Options.OptionID }, tbl_Options)); }
public IHttpActionResult Deletetbl_Options(long id) { tbl_Options tbl_Options = db.tbl_Options.Find(id); if (tbl_Options == null) { return(NotFound()); } db.tbl_Options.Remove(tbl_Options); db.SaveChanges(); return(Ok(tbl_Options)); }