In C#, we cannot directly access a protected static property on an instance of a class. However, we can access the protected static property through a public or protected static method defined in the class.
Here's an example of a class with a protected static property and a public static method that accesses the property:
main.cs198 chars8 lines
To access the protected static property, you can call the public static method as follows:
main.cs84 chars3 lines
Note that we call the method on the class itself, not on the instance of the class.
gistlibby LogSnag