c# - Private const defined on class level and then used on an attribute, why this compile? -


have @ following code:

public class person {     private const string myconst = "somevalue";      [myattribute(myconst)]     public string name {get;set;} } 

myconst defined private , in opinion should not accessible myattribute. code compiles well.

anyone knows reason?

private members accessible within same class body they're declared. guess it's accessible because you're declaring , using in same class.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -