Example #1
0
        public ActionResult Edit(int id)
        {
            Product product = _productBusiness.GetById(id);

            if (product == null)
            {
                return(HttpNotFound());
            }

            ViewBag.SelectedCategory = product.ProductCategories.ToList();
            var tagsList = _tagBusiness.GetByProductId(id).Select(t => t.TagName);

            ViewBag.Tags       = string.Join(",", tagsList);
            ViewBag.Categories = _categoryBusiness.Get();
            return(View(product));
        }