Question

Is there any equivalent keyword in C# to reference the class from within itself on static method calls, without using the proper class name?

The PHP equivalent would be self.

Was it helpful?

Solution

If it happens inside the class, you don't need to use reference. Just using the method/property name will work, since it is in the current scope. If it is in another class, then it's not SELF, so you need to use the classname.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top