Beispiel #1
0
        // POST: odata/T_JISHUI_R
        public IHttpActionResult Post(T_JISHUI_R T_JISHUI_R)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.T_JISHUI_R.Add(T_JISHUI_R);
            db.SaveChanges();

            return(Created(T_JISHUI_R));
        }
Beispiel #2
0
        // DELETE: odata/T_JISHUI_R(5)
        public IHttpActionResult Delete([FromODataUri] decimal key)
        {
            T_JISHUI_R T_JISHUI_R = db.T_JISHUI_R.Find(key);

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

            db.T_JISHUI_R.Remove(T_JISHUI_R);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult Patch([FromODataUri] decimal key, Delta <T_JISHUI_R> patch)
        {
            Validate(patch.GetEntity());

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

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

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

            patch.Patch(T_JISHUI_R);

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

            return(Updated(T_JISHUI_R));
        }