Пример #1
0
        // PUT: odata/sysdiagrams(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <sysdiagrams> patch)
        {
            Validate(patch.GetEntity());

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

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

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

            patch.Put(sysdiagrams);

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

            return(Updated(sysdiagrams));
        }
Пример #2
0
        // PUT: odata/Allergenes(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Allergene> patch)
        {
            Validate(patch.GetEntity());

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

            Allergene allergene = db.Allergene.Find(key);

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

            patch.Put(allergene);

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

            return(Updated(allergene));
        }
Пример #3
0
        // PUT: odata/Burgers(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Burger> patch)
        {
            Validate(patch.GetEntity());

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

            Burger burger = db.Burger.Find(key);

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

            patch.Put(burger);

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

            return(Updated(burger));
        }
Пример #4
0
        // PUT: odata/UserGroups(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <UserGroup> patch)
        {
            Validate(patch.GetEntity());

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

            UserGroup userGroup = db.UserGroup.Find(key);

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

            patch.Put(userGroup);

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

            return(Updated(userGroup));
        }
        // PUT: odata/Ingredients(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <Ingredient> patch)
        {
            Validate(patch.GetEntity());

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

            Ingredient ingredient = db.Ingredient.Find(key);

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

            patch.Put(ingredient);

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

            return(Updated(ingredient));
        }