public async Task <IActionResult> PutRecipe(int id, Recipe recipe)
        {
            if (id != recipe.RecipeId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutContainerStatus(int id, ContainerStatus containerStatus)
        {
            if (id != containerStatus.ContainerStatusId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> PutUseDuring(int id, UseDuring useDuring)
        {
            if (id != useDuring.UseDuringId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutSupplierAddress(int id, SupplierAddress supplierAddress)
        {
            if (id != supplierAddress.SupplierId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutProductContainerInventory(int id, ProductContainerInventory productContainerInventory)
        {
            if (id != productContainerInventory.ContainerSizeId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #6
0
        public async Task <IActionResult> PutAccount(int id, Account account)
        {
            if (id != account.AccountId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutIngredientUsedIn(int id, IngredientUsedIn ingredientUsedIn)
        {
            if (id != ingredientUsedIn.IngredientId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #8
0
        public async Task <IActionResult> PutAppConfig(int id, AppConfig appConfig)
        {
            if (id != appConfig.BreweryId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        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 #10
0
        public async Task <IActionResult> PutMashStep(int id, MashStep mashStep)
        {
            if (id != mashStep.MashStepId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #11
0
        public async Task <IActionResult> PutFermentable(int id, Fermentable fermentable)
        {
            if (id != fermentable.IngredientId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }