Monday 6 June 2016

DataContractSerializer Vs XmlSerializer in WCF?



DataContractSerializer:-
   
    1.    It is used for serialization\deserialization of class in WCF service to and from either JSON or XML.
    2.    It Serialize property and field.
    3.    Does not control over full xml serialization.
    4.    It is faster than XMLSerialization.
    5.    DataContractSerializer serializes all members which are marked with [DataMember] attribute even if member is marked as private. 

    XMLSerializer:-
 
    1.    It is used only for XML.
    2.    It serialized only property.
    3.    Control over full xml structure.
     4.       It serialize only public member.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.