Yes I\'ve seen this but I couldn\'t find the answer to my specific question.
Given a lambda testLambda that takes T and returns a boolean (I can mak
Easy:
Func func = x => x.Length > 5;
Predicate predicate = new Predicate(func);
Basically you can create a new delegate instance with any compatible existing instance. This also supports variance (co- and contra-):
Action
If you want to make it generic:
static Predicate ConvertToPredicate(Func func)
{
return new Predicate(func);
}