开发者

Different Scoped Properties - Public getter and internal setter

开发者 https://www.devze.com 2023-03-04 15:33 出处:网络
I know you can do this public String<T> Get { get; private set; } The problem is I want the set method to开发者_C百科 be accessible from a different class within the same DLL (ie: internal)

I know you can do this

public String<T> Get { get; private set; }

The problem is I want the set method to开发者_C百科 be accessible from a different class within the same DLL (ie: internal)

Is this possible?


Yes, you can use any access modifier with either automatic property accessor:

public String<T> Get { get; internal set; }
0

精彩评论

暂无评论...
验证码 换一张
取 消