I have a method with two overloads, as follows:
bool Evaluate(Func<bool> condition)
{
// Some logic
return condition.Invoke();
}
bool Evaluate<T>(Func<T, bool> condition, T value)
{
// Same logic as the first method overload
return condition.Invoke(value);
}
Since both method overloads contain largely identical logic, I wish to chain them together, but I can't see how to do this. I imagine the first method overoad needs to construct a delegate that it passes to the second overload, but it's not clear what form this delegate should take.
Many thanks for your advice,
Tim