Exemple #1
0
        public IViewComponentResult Invoke(bool footerNavigation)
        {
            var viewName       = footerNavigation ? "Footer" : "Menu";
            var menuItems      = footerNavigation ? navigationRepository.GetFooterNavigationItems() : navigationRepository.GetMenuItems();
            var menuItemsModel = menuItems.Select(menuItem => MenuItemViewModel.GetViewModel(menuItem, pageUrlRetriever));

            return(View($"~/Components/ViewComponents/Navigation/{viewName}.cshtml", menuItemsModel));
        }