I'm trying to figure out if something like this is possible:
string simpleMethod = "public void Hello() { Console.WriteLine(\"Hello\"); }"
ExecuteMethod(simpleMethod);
public void ExecuteMethod(string myMethod)
{
//???
}
Expected output:
Hello
I know the above example is probably bad practice, but I am curious to know if it is even possible to do somehow. Any help or insight would be greatly appreciated, thanks.