14 lines
1.1 KiB
Plaintext
14 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Serialization event handlers that don't have the correct signature will not be called, bypassing augmentations to the automated de/serialization.
|
|
|
|
A method is designated a serialization event handler by applying one of the following serialization event attributes:
|
|
|
|
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializingattribute[`OnSerializingAttribute`]
|
|
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.onserializedattribute[`OnSerializedAttribute`]
|
|
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializingattribute[`OnDeserializingAttribute`]
|
|
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.ondeserializedattribute[`OnDeserializedAttribute`]
|
|
|
|
Serialization event handlers take a single parameter of type https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.streamingcontext[`StreamingContext`], return `void`, and have `private` visibility.
|
|
|
|
This rule raises an issue when any of these constraints are not respected. |