public async Task <IActionResult> PutBrewContainer(int id, BrewContainer brewContainer)
        {
            if (id != brewContainer.BrewContainerId)
            {
                return(BadRequest());
            }

            _context.Entry(brewContainer).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BrewContainerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutRecipeIngredient(int id, RecipeIngredient recipeIngredient)
        {
            if (id != recipeIngredient.RecipeIngredientId)
            {
                return(BadRequest());
            }

            _context.Entry(recipeIngredient).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RecipeIngredientExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutIngredientInventorySubtraction(int id, IngredientInventorySubtraction ingredientInventorySubtraction)
        {
            if (id != ingredientInventorySubtraction.IngredientInventorySubtractionId)
            {
                return(BadRequest());
            }

            _context.Entry(ingredientInventorySubtraction).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IngredientInventorySubtractionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }