Ejemplo n.º 1
0
        private async Task <MenuSectionItem> CreateSectionItem(Page page, MenuSection section, List <Content> pageContents)
        {
            var menuSectionItem = MenuSectionItem.CreateMenuSectionItem(page.Name, section, page.Id);

            var id = await _menuManager.AddMenuItemAsync(menuSectionItem);

            if (menuSectionItem.Id == 0)
            {
                menuSectionItem = _menuSectionItemRepository.FirstOrDefault(id);
            }

            foreach (var pageContent in pageContents)
            {
                await CreateEditSectionItemContent(pageContent, menuSectionItem);
            }
            return(menuSectionItem);
        }