Is it possible to somehow mark a System.Array
as immutable. When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:
public class Immy
{
public string[] { get; private set; }
}
I thought the readonly
keyword might do the trick, but no such luck.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…