I've seen several answers regarding this warning (SA1126:PrefixCallsCorrectly) when using static fields/properties and others just not wanting to use this.
. However I'm at a loss in my situation:
public class MyClass
{
public string Name = nameof(MyClass);
}
this
, base
, etc. are not applicable. What should I be using? Or should I just keep ignoring the warning?
There is a workaround:
public class MyClass
{
public string Name = $"{nameof(MyClass)}";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With