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

            db.T_SLUICE_1.Add(T_SLUICE_1);
            db.SaveChanges();

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

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

            db.T_SLUICE_1.Remove(T_SLUICE_1);
            db.SaveChanges();

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

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

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

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

            patch.Patch(T_SLUICE_1);

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

            return(Updated(T_SLUICE_1));
        }