private IEnumerable GetProductsByFilter()

in src/app/ContosoTraders.Api.Core/Services/Implementations/ProductService.cs [90:99]


    private IEnumerable<Product> GetProductsByFilter(int[] brands, int[] typeIds)
    {
        var filteredProducts = _productRepository.Products
            .ToList()
            .Where(p =>
                (brands.Any() ? brands.Contains(p.BrandId.GetValueOrDefault()) : true) &&
                (typeIds.Any() ? typeIds.Contains(p.TypeId.GetValueOrDefault()) : true));

        return filteredProducts;
    }