Let's say I have a list with 2 or more customerIds and a list with two or more order dates. I want an SQL query like this from linq to sql
SELECT *
FROM Orders
WHERE (CustomerId = @CustomerId1
AND (OrderDate = @OrderDate1 OR OrderDate = @OrderDate2))
OR
(CustomerId = @CustomerId2
AND (OrderDate = @OrderDate1 OR OrderDate = @OrderDate2))
The list with CustomerIds and order dates is not fixed, so I need to loop through it when building the query.