コード例 #1
0
        // POST: odata/T_FXQLCZ
        public IHttpActionResult Post(T_FXQLCZ T_FXQLCZ)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.T_FXQLCZ.Add(T_FXQLCZ);
            db.SaveChanges();

            return(Created(T_FXQLCZ));
        }
コード例 #2
0
        // DELETE: odata/T_FXQLCZ(5)
        public IHttpActionResult Delete([FromODataUri] decimal key)
        {
            T_FXQLCZ T_FXQLCZ = db.T_FXQLCZ.Find(key);

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

            db.T_FXQLCZ.Remove(T_FXQLCZ);
            db.SaveChanges();

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

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

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

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

            patch.Patch(T_FXQLCZ);

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

            return(Updated(T_FXQLCZ));
        }