You really shouldn't use the Delegate type to store the delegate. You must use a specific type of delegate.
In almost all cases, you can use Action or Func as your delegate type. In this case, Action is suitable:
class Program { static void Test() { } static void Main(string[] args) { Action action = Test; action(); } }
You can technically get an instance of Delegate by doing the following:
Delegate d = (Action)Test;
But in fact, using Delegate , unlike the actual specific type of delegate, for example Action , will be difficult, because the compiler will no longer know what the signature of the method is, t know what parameters should be passed to it.
Servy source share