公告
财富商城
积分规则
提问
发文
2020-04-18 05:36发布
一夜七次
Possible Duplicate: Immutable List in C#
Is it possible to make a list immutable
List<T>.AsReadOnly() returns a readonly wrapper, so that you can't add/remove/replace elements.
List<T>.AsReadOnly
To be truly immutable, the type T must be an immutable Type.
You can use ReadOnlyCollection<T> instead.
ReadOnlyCollection<T>
最多设置5个标签!
List<T>.AsReadOnly
() returns a readonly wrapper, so that you can't add/remove/replace elements.To be truly immutable, the type T must be an immutable Type.
You can use
ReadOnlyCollection<T>
instead.