You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change allows to work with existence of the attribute on the Json message in same way as dynamic languages do.
(after deserialization to JavaScript for example you could test field existence by hasAttribute() function).
Changes:
- support for conditional serialization with method ShouldSerializeByName on DTO found by convention.
- The difference to existing ShouldSerializeX is that it could handle all fields not just one.
- It returns nullable bool with following meaning: True- should be on the json. False - should not be on the JSon. Null - use behavior defined by configuration and DataMemberAttribute
- support for attribute on wire detection with method OnDeserializingMember on DTO found by convention.
- it complements ShouldSerializeByName and allows to implement full roundtrip of existence of the field on the JSon message.
- it's designed in a way which allows event handler to change the deserialized object value before it's assigned to target field.
- it will give raw json string for fields which don't have member on the DTO, allowing to implement parallel to IExtensibleDataObject for Json. It allows survival and forwarding of unknown attributes.
0 commit comments