I have several methods all with the same parameter types and return values but different names and blocks. I want to pass the name of the method to run to another method tha
If you want to pass Method as parameter, use:
using System;
public void Method1()
{
CallingMethod(CalledMethod);
}
public void CallingMethod(Action method)
{
method(); // This will call the method that has been passed as parameter
}
public void CalledMethod()
{
Console.WriteLine("This method is called by passing parameter");
}