Пример #1
0
        //public IActionResult EditProduct(int productId)
        //{
        //    try
        //    {
        //        var model = _repository.GetProduct(productId);
        //        return View(model);
        //    }
        //    catch (Exception ex)
        //    {
        //        return View("Error", ex);
        //    }
        //}

        public IActionResult Products()
        {
            try
            {
                var model = _repository.GetAllProducts();
                return(View(model));
            }
            catch (Exception ex)
            {
                return(View("Error", ex));
            }
        }