Is it possible to programmatically set that you want to exclude a property from serialization?
Example:
If you want to include field during serialization but ignore it during deserialization then you can use OnDeserializedAttribute to run a method which will set default value for ID field.