Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }