I am using the || (OR) operator in the where clause of a LINQ statement. If the first oparand evaluates to true, the second operand shouldn't be evaluated as in the following example...
Code: Select all
string searchString = null;
if (true || "test".Contains(searchString))
searchString = "";
Code: Select all
string searchString = null;
var recordSet = (from m in PPCustomer.Mailings
where String.IsNullOrEmpty(searchString) || m.Subject.Contains(searchString)
select m);
Best regards
________
Subaru R1 Specifications