rspec/rules/S3926/description.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

5 lines
671 B
Plaintext

Fields marked with ``++System.Runtime.Serialization.OptionalFieldAttribute++`` are serialized just like any other field. But such fields are ignored on deserialization, and retain the default values associated with their types. Therefore, deserialization event handlers should be declared to set such fields during the deserialization process.
This rule raises when at least one field with the ``++System.Runtime.Serialization.OptionalFieldAttribute++`` attribute is declared but one (or both) of the following event handlers ``++System.Runtime.Serialization.OnDeserializingAttribute++`` or ``++System.Runtime.Serialization.OnDeserializedAttribute++`` are not present.