Read-only list or unmodifiable list in .NET 4.0

前端 未结 6 1291
清酒与你
清酒与你 2020-12-05 08:58

From what I can tell, .NET 4.0 still lacks read-only lists. Why does the framework still lack this functionality? Isn\'t this one of the commonest pieces of functionality fo

6条回答
  •  失恋的感觉
    2020-12-05 09:50

    In 2.0 you can call AsReadOnly to get a read-only version of the list. Or wrap an existing IList in a ReadOnlyCollection object.

提交回复
热议问题