/// <inheritdoc />
        public IEnumerable<TreeNode<IProductCollection>> GetRootTrees()
        {
            var cacheKey = GetCacheKey("GetRootTrees");
            var trees = (IEnumerable<TreeNode<IProductCollection>>)Cache.GetCacheItem(cacheKey);

            if (trees != null) return trees;

            var factory = new TreeNodeFactory<IProductCollection>();
            return (IEnumerable<TreeNode<IProductCollection>>)
                        Cache.GetCacheItem(cacheKey, () => factory.BuildTrees(GetAll()));
        }
 public DateTimeNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public LessThanNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public StartsWithNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public EqualsNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public SubstringOfNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public ToUpperNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 protected QueryModifier(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 protected SingleChildNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
 public GreaterThanOrEqualNode(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
 }
        private static TreeNode FromDictionary(Dictionary dic, TreeNodeFactory factory)
        {
            // Setup initial conditions.
            TreeNode node = factory(dic);

            // Enumerate children.
            Array children = dic[PropChildren] as Array;
            if (children != null)
            {
                foreach (Dictionary child in children)
                {
                    TreeNode childNode = FromDictionary(child, factory);
                    node.AddChild(childNode);
                }
            }

            // Finish up.
            return node;
        }
 /// <summary>Creates a new instance of the node from JSON.</summary>
 /// <param name="json">The JSON string to parse.</param>
 /// <param name="factory">The factory method for creating new nodes.</param>
 public static TreeNode FromJson(string json, TreeNodeFactory factory)
 {
     return FromDictionary(Helper.Json.Parse(json), factory);
 }
 protected ExplicitOrderByBase(Type inputType, IToken payload, TreeNodeFactory treeNodeFactory)
     : base(inputType, payload, treeNodeFactory)
 {
     this.IsFirstChild = false;
 }