有没有办法将方法的名称作为文本,强类型?
private void Do()
{
}
private Something ReturnSomething()
{
return new Something();
}
private void GenerateCode()
{
// ----------------
// Do().GetName;
// ReturnSomething().GetName;
// ----------------
// How to do this?
}
Run Code Online (Sandbox Code Playgroud)
我尝试了类似Do().ToString();或使用过的东西Reflection,但我找不到有用的东西.