This changes the behaviour of property mapping so that if a property is in the class but it cannot be populated, an exception is thrown, instead of it silently doing nothing. Two new attributes have been added:
[MappingOptional] (properties only)
This marks the property as optional. If a value is not found in the record, the mapper does nothing (the old default behaviour).
[MappingDefaultValue(someValue)] (properties and constructor parameters)
This provides a default value which will be put into the property or constructor if a suitable value is not found in the record.
Tests were added for the new features, as well as the specific issues raised that led to this change.
This changes the behaviour of property mapping so that if a property is in the class but it cannot be populated, an exception is thrown, instead of it silently doing nothing. Two new attributes have been added:
[MappingOptional]
(properties only) This marks the property as optional. If a value is not found in the record, the mapper does nothing (the old default behaviour).[MappingDefaultValue(someValue)]
(properties and constructor parameters) This provides a default value which will be put into the property or constructor if a suitable value is not found in the record.Tests were added for the new features, as well as the specific issues raised that led to this change.