I am working on creating an immutable class.
I have marked all the properties as read-only.
I have a list of items in the class.
Although if the property is read-only the list can be modified.
Exposing the IEnumerable of the list makes it immutable.
I wanted to know what is the basic rules one has to follow to make a class immutable ?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…