public IEnumerable <Category> Tree(string siteId) { var allEles = cateProvider.Query(siteId); var cates = HierarchyHelper.Build(allEles, o => o.ParentId == null, (p, c) => c.ParentId == p.CategoryId, (p, c) => p.Children.Add(c)); return(cates); }