What is internal set property in c#?

前端 未结 8 656
悲&欢浪女
悲&欢浪女 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:22

    If you have a property with an internal set accessor (and public get accessor) it means that code within the assembly can read (get) and write (set) the property, but other code can only read it.

    You can derive the above information by reading about the internal access modifier, the public access modifier and properties.

    Also, you can read about Restricting Accessor Accessibility.

提交回复
热议问题