public CategoryView ToView() { var categoryView = new CategoryView { Id = Id, Name = Name, ParentId = ParentId, Description = Tools.Render(Description, FileData), CategoriesCount = Categories.Count(), Categories = Categories.Select(c => c.ToLink()).ToArray(), ProblemsCount = Problems.Count(), ExercisesCount = Exercises.Count(), QuizCount = Quiz.Count() }; return(categoryView); }