I want to read in the id but I don't want it to be set once it's read in. The _processing variable is set while reading in the file and deserializing so it can be set. Is there a built-in more elegant way of handling this?
private string _id;
[JsonProperty(PropertyName = "id")]
public string id
{
get { return _id; }
set
{
if (_processing) // Only allow when reading the file
{
_id = value;
}
}
}