Пример #1
0
        public IViewComponentResult Invoke(int id)
        {
            if (id == 0)
            {
                var prodDetailsVm = new ProductDetailsViewModel()
                {
                    Product        = prodRepo.Get(id),
                    AttributeGroup = attrGroupRepo.Get(id),
                    OneAttribute   = OneAttributeRepo.Get(id)
                };

                return(View(prodDetailsVm));
            }
            else
            {
                var prod      = prodRepo.Get(id);
                var prodSub   = subCatRepo.Get(prod.Id);
                var attrGroup = attrGroupRepo.Get(prodSub.Id);

                return(View());
            }
        }
Пример #2
0
 public IActionResult Get(int id)
 {
     return(View(attrGroupRepo.Get(id)));
 }