In C# when I want to call a static method of a class from another static method of that class, is there a generic prefix that I can use such as PHP\'s
There's no real equivalent - you have to either specify the class name, i.e.
Customer.DatabaseConnectionExists()
or miss out the qualifier altogether, i.e.
DatabaseConnectionExists()
The latter style of calling is advisable since it's simpler and doesn't lose any meaning. Also, it's more inline with method calling in instances (i.e. calling by InstanceMethod()
and not this.InstanceMethod()
, which is overly verbose).