rspec/rules/S3927/description.adoc
kevin.hinz fc68332d73
Modify rule S3927: Update rule description (#3712)
* 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>
2024-03-15 14:38:53 +01:00

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.