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; } }
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(); } } }
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(); } } }
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(); } } }