rspec/rules/S2553/csharp/rule.adoc

30 lines
609 B
Plaintext
Raw Normal View History

The ``++ISerializable++`` interface gives you control over _how_ your class is serialized, but does not itself make the class serializable. Such classes must also have the ``++[Serializable]++`` attribute.
== Noncompliant Code Example
----
public class Person : ISerializable { // Noncompliant; [Serializable] attribute missing
// ...
}
----
== Compliant Solution
----
[Serializable]
public class Person : ISerializable {
// ...
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]