My problem is as follows:
public abstract class A {}
public class B : A {
public static IList<B> MyMethod(){ return new List<B>();}
}
public delegate IList<T> MyDelegate<T>() where T : A;
...
public static void CalledMethod<T>() where T : A{
MyDelegate<T> del = B.MyMethod; // This doesn't work
}
Can anyone explain the best way to get this to work?
Thanks for any help.
edited to fix example.
Here’s why this will not work
This means that
delwill be of typeMyDelegate<C>which does not work withB.MyMethodbecauseCis not aB.