I developed a class with two properties - both a string type and a list of objects. I load xml and deserialize it into an instance of a class that works very well. I want everything about each instance to be immutable. These classes are displayed as APIs, and for integrity, I do not want to change the values of the object. If the programmer wants something else, they must create new instances and set the values then.
I usually did this using the ReadOnlyCollection and readonly properties, but this interferes with deserialization. What can i do here?
source
share