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
Post a Comment