Is there a .NET collection interface that prevents adding objects?

前端 未结 7 1671
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 18:13

I have a class that maintains list of objects of another class. List of objects is a public property. I would like to prevent users from adding and removing objects directly

相关标签:
7条回答
  • 2020-12-18 18:54

    You could just give them an object which always returns an enumerator that they can use to access the structure?

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