i have a generic class in which i want to save a delegate that uses Type T as argument and return value. How do i assign a method to the attribute getValueDefault?
private delegate TOut GetValueDefault<in TIn, TOut>(string key, TIn defaultValue);
private GetValueDefault<T, T> getValueDefault = null;
For example a method with the signature bool ThirdPartyClass.foo(string key, bool defValue)
It should be as easy as:
However, if in all situations you are going to have equal in and out type parameters, you may simplify it to: