views:

89

answers:

1
  • I am doing Binary Serilization of big nested data structure.
  • Whenever [Serilizable] attribute is added to class, all the members are automatically serialized.
  • I want to specifically select the fields that need to be serialized.
  • As of now i am using [NonSerialized] Attribute for fields to opt out from serilization.

  • Is there any way i can opt out all fields by default and then select only the fields i need, by using some attribute ?

+1  A: 

You can control the serialization yourself by implementing ISerializable and writing a serialization constructor. For more information, read this article.

SLaks