Fields should be specified in _PascalCase. Always with a leading underscore, regardless of visibility modifier.
Allowed
class SomeClass
{
public string _MyField;
}Disallowed
class SomeClass
{
public string _myField;
public string myField;
}Fields should be PascalCase
Allowed
class SomeClass
{
public string MyProperty { get; set; }
}Disallowed
class SomeClass
{
public string myProperty { get; set; }
public string _MyProperty { get; set; }
}Methods, including local functions, should be PascalCase
Allowed
class SomeClass
{
public string GetEmpty() {
var output = LocalFunction();
string LocalFunction() {
return string.Empty();
}
return output;
}
}Disallowed
class SomeClass
{
public string getEmpty() {
var output = localFunction();
string localFunction() {
return string.Empty();
}
return output;
}
}