I like to send a generic type converter function to a method but I can\'t figure out how to do it.
Here\'s invalid syntax that explains what I like to achieve, the p
You have to know the T type at compile-time to use it. The T can either be specified at class-level or at method-level.
class SomeClass { public void SomeUtility(Func converter) { var myType = converter("foo"); // Already is the T-type that you specified. } }
or
public void SomeUtility(Func converter) { var myType = converter("foo"); // Already is the T-type that you specified. }