otherwise during deserialization even if property marked as "readonly" (Writable == false) it's ValueProvider.GetValue() is triggered and the result is passed to property converter ReadJson method as existingValue and deserialization occurs. But final value is not used anywhere (field has not setter defined).
I see follwing issues here:
1. Useless extra call during deserialization. Perfmonace: image that my field getter makes a heavy calls to DB
2. Extra coding. If I have custom json converter for my field type I have to implement ReadJson method, but what for (field is readonly and should be never deserialized back)?
In case you do include readonly field (setter == null)
conventions.ForType<TDocument>().IncludeField(x => SuggestionsSource(x));
it is better to specify property ObjectCreationHandling value:
ObjectCreationHandling = ObjectCreationHandling.Replace
otherwise during deserialization even if property marked as "readonly" (Writable == false) it's ValueProvider.GetValue() is triggered and the result is passed to property converter ReadJson method as existingValue and deserialization occurs. But final value is not used anywhere (field has not setter defined).
I see follwing issues here:
1. Useless extra call during deserialization. Perfmonace: image that my field getter makes a heavy calls to DB
2. Extra coding. If I have custom json converter for my field type I have to implement ReadJson method, but what for (field is readonly and should be never deserialized back)?