public async Task <IViewComponentResult> InvokeAsync(NavMenuWidget model)
        {
            var viewModel = model.ProjectToViewModel();

            ViewData["siteId"]            = _siteContext.SiteId;
            ViewData["navMenuSelectList"] = GetNavMenuSelectList();

            return(View(viewModel));
        }
Beispiel #2
0
        public static NavMenuWidgetViewModel ProjectToViewModel(this NavMenuWidget model)
        {
            var viewModel = new NavMenuWidgetViewModel()
            {
                Id        = model.Id,
                Title     = model.Title,
                NavMenuId = model.NavMenuId
            };

            return(viewModel);
        }
Beispiel #3
0
        public static NavMenuWidget ProjectToModel(this NavMenuWidgetViewModel viewModel)
        {
            var model = new NavMenuWidget()
            {
                Id        = viewModel.Id,
                Title     = viewModel.Title,
                NavMenuId = viewModel.NavMenuId
            };

            return(model);
        }