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()); } }
public IActionResult Get(int id) { return(View(attrGroupRepo.Get(id))); }