Using C# 3.5 I wanted to build up a predicate to send to a where clause piece by piece. I have created a very simple Console Application to illustrate the solution that I a
If you want to combine predicates, try this;
public static Predicate Combine(params Predicate[] predicates) { return t => predicates.All(pr => pr(t)); }
You call it like this;
Predicate shortAndSweet = Combine ( s => s.Length < 10, // short, s => s == "sweet" // and sweet );