private ProductFilterGroupNode CreateNodeData(IProductFilterGroup group, IEnumerable <Tuple <IEnumerable <Guid>, int> > tuples, params Guid[] collectionKeys)
        {
            var contextKey = GetContextKey(group, collectionKeys);

            var primedFilters = new List <IPrimedProductFilter>();

            var results = tuples as Tuple <IEnumerable <Guid>, int>[] ?? tuples.ToArray();

            foreach (var f in group.Filters)
            {
                var filterContextKey = GetContextKey(f, collectionKeys);
                var ppf = new PrimedProductFilter
                {
                    Key          = f.Key,
                    Name         = f.Name,
                    ParentKey    = f.Key,
                    ProviderMeta = f.ProviderMeta,
                    SortOrder    = f.SortOrder,
                    Count        = GetCountFromResult(filterContextKey, results),
                    ExtendedData = f.ExtendedData
                };
                primedFilters.Add(ppf);
            }

            var node = new ProductFilterGroupNode
            {
                Keys = collectionKeys,
                Item =
                    new PrimedProductFilterGroup
                {
                    Key          = group.Key,
                    Name         = group.Name,
                    ProviderMeta = group.ProviderMeta,
                    SortOrder    = group.SortOrder,
                    Count        = GetCountFromResult(contextKey, results),
                    Filters      = primedFilters,
                    ExtendedData = group.ExtendedData
                }
            };

            return(node);
        }
        private ProductFilterGroupNode CreateNodeData(IProductFilterGroup group, IEnumerable<Tuple<IEnumerable<Guid>, int>> tuples, params Guid[] collectionKeys)
        {
            var contextKey = GetContextKey(group, collectionKeys);

            var primedFilters = new List<IPrimedProductFilter>();

            var results = tuples as Tuple<IEnumerable<Guid>, int>[] ?? tuples.ToArray();

            foreach (var f in group.Filters)
            {
                var filterContextKey = GetContextKey(f, collectionKeys);
                var ppf = new PrimedProductFilter
                              {
                                  Key = f.Key,
                                  Name = f.Name,
                                  ParentKey = f.Key,
                                  ProviderMeta = f.ProviderMeta,
                                  SortOrder = f.SortOrder,
                                  Count = GetCountFromResult(filterContextKey, results),
                                  ExtendedData = f.ExtendedData
                              };
                primedFilters.Add(ppf);
            }

            var node = new ProductFilterGroupNode
                           {
                               Keys = collectionKeys,
                               Item =
                                   new PrimedProductFilterGroup
                                       {
                                           Key = group.Key,
                                           Name = group.Name,
                                           ProviderMeta = group.ProviderMeta,
                                           SortOrder = group.SortOrder,
                                           Count = GetCountFromResult(contextKey, results),
                                           Filters = primedFilters,
                                           ExtendedData = group.ExtendedData
                                       }
                           };

            return node;
        }