Having trouble assigning to a generic delegate in C# -
Having trouble assigning to a generic delegate in C# -
my problem follows:
public abstract class {} public class b : { public static ilist<b> mymethod(){ homecoming new list<b>();} } public delegate ilist<t> mydelegate<t>() t : a; ... public static void calledmethod<t>() t : a{ mydelegate<t> del = b.mymethod; // doesn't work }
can explain best way work?
thanks help.
edited prepare example.
here's why not work
public class c: {} calledmethod<c>();
this means del
of type mydelegate<c>
not work b.mymethod
because c
not b
.
c#
Comments
Post a Comment