Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

QuestPond’s Interview Questions & Answers on learning serialization events

In case of DataContractserialzier, during serialization and deserialization constructor won’t get invoked. However DataContractserializer supports callbacks which we can use for initialization.

These callbacks works with the help of some special attributes

  • OnDeserializedAttribute– Marks method to be invoked immediately after the object is deserialized.
  • OnDeserializingAttribute – Marks method to be invoked during deserialization of an object.
  • OnSerializedAttribute– Marks method to be invoked immediately after the object is Serialized.
  • OnSerializingAttribute – Marks method to be invoked during Serialization of an object.

    public class MyData
    voidOnDeserialized(StreamingContext c)
    voidOnDeserializing(StreamingContext c)
    voidOnSerialized(StreamingContext c)
    voidOnSerializing(StreamingContext c)

For technical trainings on various topics like WCF, MVC, Business Intelligence, Design Patterns, WPF, TFS and Basic fundamentals feel free to contact or visit

For more stuff like this, click here. Subscribe to article updates or follow at twitter @SukeshMarla

See following video on WCF(Windows Communication Foundation) One way contract: -

Click and see here for more training on WCF(Windows Communication Foundation).

Helpful Website Url
Share this article   |    Print    |    Article read by 3013 times
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles: No related article
Related Interview Questions: No related interview question