public IViewComponentResult Invoke() { if (RouteData.Values["action"].ToString() == "Index") { ViewBag.SelectedCategory = RouteData?.Values["id"]; } return(View(CategoryRepository.Categories())); }
public IEnumerable <Category> Categories() { return(categoryRepository.Categories()); }