You can use boolean operators, like the && operator instead of the two 'where' clauses, and the | operator for an OR operation. For example, your first example would be:
<br />var results = from items in collection<br /> where from.SomeProperty == SomeValueDefinedEarlier<br /> && from.SomeOtherProperty == SomeOtherValueDefinedEarlier<br />
Second example would be something like this:
<br />var results = from items in collection<br /> where ((from.SomeProperty == SomeValueDefinedEarlier)<br /> && (from.SomeOtherProperty == SomeOtherValueDefinedEarlier))<br /> || ((from.SomeProperty == SomeValueDefinedEarlier2)<br /> && (from.SomeOtherProperty == SomeOtherValueDefinedEarlier2))<br />
modified on Tuesday, May 26, 2009 6:25 AM