public IActionResult Create(PageViewModel model) { if (ModelState.IsValid) { _pageService.Create(model.Page); var sections = model.ActiveSections.Where(x => x.Value == true).Select(x => x.Key); _sectionService.AddPageSections(sections, model.Page.Id); if (model.IsInMenu) { _menuService.AddToMenu(model.Page); } _pageService.Commit(); return(RedirectToAction("Index")); } return(View(model.Page)); }