Esempio n. 1
0
        private IEnumerable <CategoryModel> BuildCategories(List <CategoryData> categories, int root = 0)
        {
            if (!categories.Any())
            {
                //throw Exception here
                ;
            }

            var builtCategories = MenuBuilder.BuildCategoriesHierarchy(categories.OfType <CategoryData>(), root);

            return(builtCategories.Select(x => x.MapTo()));
        }