Пример #1
0
        // POST: odata/T_RVEVS_R
        public IHttpActionResult Post(T_RVEVS_R T_RVEVS_R)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.T_RVEVS_R.Add(T_RVEVS_R);
            db.SaveChanges();

            return(Created(T_RVEVS_R));
        }
Пример #2
0
        // DELETE: odata/T_RVEVS_R(5)
        public IHttpActionResult Delete([FromODataUri] string key)
        {
            T_RVEVS_R T_RVEVS_R = db.T_RVEVS_R.Find(key);

            if (T_RVEVS_R == null)
            {
                return(NotFound());
            }

            db.T_RVEVS_R.Remove(T_RVEVS_R);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #3
0
        public IHttpActionResult Patch([FromODataUri] string key, Delta <T_RVEVS_R> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            T_RVEVS_R T_RVEVS_R = db.T_RVEVS_R.Find(key);

            if (T_RVEVS_R == null)
            {
                return(NotFound());
            }

            patch.Patch(T_RVEVS_R);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!T_RVEVS_RExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(T_RVEVS_R));
        }