Пример #1
0
        public async Task <IActionResult> UpdateProduct(ProductModel model)
        {
            var searched = await storageTableService.GetProduct(model.Id);

            if (searched is null)
            {
                return(NotFound());
            }

            var entity = ProductEntity.Load(model);
            await storageTableService.Create(entity);

            ViewBag.Message = "Product was updated correctly";
            return(RedirectToAction(nameof(ProductIndex)));
        }