In LINQ one can build a LINQ query progressively as follows:
var context = new AdventureWorksDataContext();
// Step 1
var query = context.Customers.Where(d => d.CustomerType == "Individual");
// Step 2
query = query.Where(d => d.TerritoryID == 3);
The above query would yield an equivalent SQL statement with a WHERE clause comprising of two predicates combined together by an AND logical operator like the following:
SELECT * FROM Customers WHERE CustomerType = 'Individual' AND TerritoryID = 3
Can one build a LINQ query to yield an equivalent SQL statement, progressively
, such that the resulting query has a WHERE clause with the predicates combined together by an OR logical operator as follows?
SELECT * FROM Customers WHERE CustomerType = 'Individual' OR TerritoryID = 3