I would like to be able to store various static methods in a List and later look them up and dynamically call them.
Each of the static methods has different numbers of a
You actually don't need the power of dynamic
here, you can do with simple List
:
class Program
{
static int f(int x) { return x + 1; }
static void g(int x, int y) { Console.WriteLine("hallo"); }
static void Main(string[] args)
{
List
(well, you need a cast, but you need to somehow know the signature of each of the stored methods anyway)