
* Modify rule S3927: Update rule description Changes suggested by the Docs Squad: - use full word in place of short-hand text * Update rule S3927: improve word choice Co-authored-by: Tim Pohlmann <tim.pohlmann@sonarsource.com> --------- Co-authored-by: Tim Pohlmann <tim.pohlmann@sonarsource.com>
15 lines
1.1 KiB
Plaintext
15 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 automated serialization and deserialization events.
|
|
|
|
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.
|