Beispiel #1
0
        public async Task <IActionResult> PutIngredients(int id, Ingredient ingredients)
        {
            if (id != ingredients.Id)
            {
                return(BadRequest());
            }
            try
            {
                await _ingredient.PutIngredients(id, ingredients);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!await _ingredient.IngredientsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }