public ExampleSection GetRootSections() { ExampleSection forum = new ExampleSection(); var collection = _sectionRepository.AsQueryable().Where(s => s.ParentId == null).ToList(); forum.ChildSections = collection.Select(s => new ExampleSection { Id = s.Id, Title = s.Title, Description = s.Description, CreatedDate = s.CreatedDate, ModifiedDate = s.ModifiedDate }) .ToList(); return(forum); }