What is internal set property in c#?

前端 未结 8 559
悲&欢浪女
悲&欢浪女 2021-02-01 01:01

I just came across an unknown concept of c# for me. Can anyone tell me what the purpose of an internal set property is? What is its use? I know internal keyword is used for work

相关标签:
8条回答
  • 2021-02-01 01:38

    If a property setter is marked with the internal access modifier, only classes that reside within the assembly can set the property.

    public string MyProperty { get; internal set; }
    
    0 讨论(0)
  • 2021-02-01 01:38

    It is a construct which allows the value of a property to be set only by code within the same assembly.

    0 讨论(0)
提交回复
热议问题