列印引數名稱
片段
public void DoSomething(int paramValue)
{
Console.WriteLine(nameof(paramValue));
}
...
int myValue = 10;
DoSomething(myValue);
控制檯輸出
paramValue
public void DoSomething(int paramValue)
{
Console.WriteLine(nameof(paramValue));
}
...
int myValue = 10;
DoSomething(myValue);
paramValue