You can certainly do it within a Where clause (extension method). If you need to build a complex query dynamically, though, you can use a PredicateBuilder.
var query = collection.Where( c => c.A == 1 || c.B == 2 );
Or using a PredicateBuilder
var predicate = PredicateBuilder.False<Foo>();
predicate = predicate.Or( f => f.A == 1 );
if (allowB)
{
predicate = predicate.Or( f => f.B == 1 );
}
var query = collection.Where( predicate );
This is built into .net now, not sure if it previously wasn't. Given an existing Linq query you can add a where clause that takes an array of strings (SearchStrings), and check if any of them match whatever object in the collection you're search. Using ToLower() just makes sure that you avoid case sensitivity in SQL queries.