コード例 #1
0
 private void ProcessWithNoFilters(SearchResults results)
 {
     results.Shirts = _shirts;
     foreach (var size in Size.All)
     {
         results.GetSizeCount(size).Count = _indexBySize.GetShirts(size).Count;
     }
     foreach (var color in Color.All)
     {
         results.GetColorCount(color).Count = _indexByColor.GetShirts(color).Count;
     }
 }
コード例 #2
0
 private void ProcessWithSizeFilter(SearchOptions options, SearchResults results)
 {
     foreach (var size in options.Sizes)
     {
         var shirtsFilteredBySize = _indexBySizeAndColor.GetShirtsSplitBySize(size);
         foreach (var color in shirtsFilteredBySize.Keys)
         {
             var shirts = shirtsFilteredBySize[color];
             results.GetSizeCount(size).Count   += shirts.Count();
             results.GetColorCount(color).Count += shirts.Count();
         }
     }
 }
コード例 #3
0
 private void ProcessWithColorFilter(SearchOptions options, SearchResults results)
 {
     foreach (var color in options.Colors)
     {
         var shirtsFilteredByColor = _indexByColorAndSize.GetShirts(color);
         foreach (var size in shirtsFilteredByColor.Keys)
         {
             var shirts = shirtsFilteredByColor[size];
             results.Shirts.AddRange(shirts);
             results.GetSizeCount(size).Count   += shirts.Count();
             results.GetColorCount(color).Count += shirts.Count();
         }
     }
 }
コード例 #4
0
        private void ProcessWithColorAndSizeFilters(SearchOptions options, SearchResults results)
        {
            foreach (var size in options.Sizes)
            {
                foreach (var color in options.Colors)
                {
                    var shirts = _indexByColorAndSize.GetShirts(color, size);

                    results.Shirts.AddRange(shirts);
                    results.GetSizeCount(size).Count   += shirts.Count();
                    results.GetColorCount(color).Count += shirts.Count();
                }
            }
        }