I am trying to write a class in C# with [Serializable()] mark. Then I noticed that there are some situations the NonSerializedAttribute mark is needed.
- The event delegate could not be serialized
- Constant member, such as NonSerialized attribute on a constant
- Something sensitive data that need to be prevented the serialization.
I am curious about when should I use [NonSerializedAttribute()]
in other conditions besides these rules?
Any comments or suggestions are welcome.