public IHttpActionResult PostRBU_view(RBU_view rBU_view) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.RBU_view.Add(rBU_view); try { db.SaveChanges(); } catch (DbUpdateException) { if (RBU_viewExists(rBU_view.id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = rBU_view.id }, rBU_view)); }
public IHttpActionResult PutRBU_view(int id, RBU_view rBU_view) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != rBU_view.id) { return(BadRequest()); } db.Entry(rBU_view).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!RBU_viewExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetRBU_view(int id) { RBU_view rBU_view = db.RBU_view.Find(id); if (rBU_view == null) { return(NotFound()); } return(Ok(rBU_view)); }
public IHttpActionResult DeleteRBU_view(int id) { RBU_view rBU_view = db.RBU_view.Find(id); if (rBU_view == null) { return(NotFound()); } db.RBU_view.Remove(rBU_view); db.SaveChanges(); return(Ok(rBU_view)); }