Linq to objects Predicate Builder
问题 What is the best way to do a conditional query using linq to objects(not linq to sql). Currently I am using the Predicate builder found here http://www.albahari.com/nutshell/predicatebuilder.aspx and passing the compiled predicate to the IEnumerable.Where and it seems to work nicely. Example code of what I want to solve: eg I have this string keyword1 = "Test1"; string keyword2 = "Test3"; IEnumerable<TestObject> tests = new List<TestObject>() { new TestObject() {Name1 = "Test1", Name2 =