private CategoryMenuItem Map(Category category) { var categoryMenuItem = new CategoryMenuItem { Id = category.Id, Name = category.Name, SeoTitle = category.SeoTitle }; var childCategories = category.Child; foreach (var childCategory in childCategories) { var childCategoryMenuItem = Map(childCategory); categoryMenuItem.AddChildItem(childCategoryMenuItem); } return categoryMenuItem; }
private CategoryMenuItem Map(Category category) { var categoryMenuItem = new CategoryMenuItem { Id = category.Id, Name = category.Name, SeoTitle = category.SeoTitle }; var childCategories = category.Children; foreach (var childCategory in childCategories.OrderByDescending(x => x.DisplayOrder)) { var childCategoryMenuItem = Map(childCategory); categoryMenuItem.AddChildItem(childCategoryMenuItem); } return(categoryMenuItem); }
private CategoryMenuItem Map(Category category) { var categoryMenuItem = new CategoryMenuItem { Id = category.Id, Name = category.Name, SeoTitle = category.SeoTitle }; var childCategories = category.Children; foreach (var childCategory in childCategories) { var childCategoryMenuItem = Map(childCategory); categoryMenuItem.AddChildItem(childCategoryMenuItem); } return(categoryMenuItem); }
private CategoryMenuItem Map(Category category) { var categoryMenuItem = new CategoryMenuItem { Id = category.Id, Name = _contentLocalizationService.GetLocalizedProperty(category, nameof(category.Name), category.Name), Slug = category.Slug }; var childCategories = category.Children; foreach (var childCategory in childCategories.OrderByDescending(x => x.DisplayOrder)) { var childCategoryMenuItem = Map(childCategory); categoryMenuItem.AddChildItem(childCategoryMenuItem); } return(categoryMenuItem); }
private CategoryMenuItem Map(area category) { var categoryMenuItem = new CategoryMenuItem { Id = long.Parse(category.division), Name = category.areaname, Slug = category.slug }; var childCategories = category.hijos; foreach (var childCategory in childCategories.OrderByDescending(x => x.areaname)) { var childCategoryMenuItem = Map(childCategory); categoryMenuItem.AddChildItem(childCategoryMenuItem); } return(categoryMenuItem); }