How do you specify a NonSerialized field with pu开发者_StackOverflowblic accessors for XML Serialization?
[Serializable] class MyClass { [NonSerialized] int Foo { get; set; } // error [NonSerialized] int bar; // ok
I came across this question on transcender: What should you apply to a field if its value is not required during deserialization?
I have a data object that is deep-cloned using a binary serialization. This data object supports property changed events, for example, PriceChanged.
I can\'t find \"field\" listed as a C# keywo开发者_开发知识库rd anywhere.Does anyone know the background on this?This is necessary, for example, if you are marking an event as non-serializable. It spe