I'm trying to pass a Predicate to a function but it has no input. I'm actually trying to delay the computation until the call is made.
Is there a way to use c# Predicate type for that? If not why.
I know a way to do this with Func
Func<bool> predicate = () => someConditionBool;
But I want to do this:
Predicate<> predicate = () => someConditionBool;
Func<bool>
is the correct type. – Infractpublic delegate bool Predicate();
– SpodeFunc<bool>
? It's not clear what problem you are trying to solve. – ImpeccantPredicate
is just a synonym forFunc<T,bool>
– Epistyle