예제 #1
0
        private static PathTree GetRouteTree(SiteDb db, byte ObjectType = 0)
        {
            var filter = db.Routes.Query;

            if (ObjectType != 0)
            {
                filter.Where(o => o.DestinationConstType == ObjectType);
            }

            var routelist = filter.SelectAll();

            PathTree tree = new PathTree();

            foreach (var item in routelist)
            {
                tree.AddOrUpdate(item);
            }

            // append system routes...
            //if (ObjectType == 0)
            //{
            //    var systemroutes = Kooboo.Sites.Systems.Routes.DefaultRoutes();
            //    foreach (var item in systemroutes)
            //    {
            //        tree.AddOrUpdate(item);

            //        Cache.SiteObjectCache<Route>.AddOrUpdate(db, item);
            //    }
            //}

            return(tree);
        }