c# - What are the advantages of using [DataContract] rather than [Serializable] in WCF -
any advantage using datacontract?
see great comparison of xmlserializer , datacontractserializer on dan rigsby's blog.
some points in favor of datacontractserializer:
- about 10% faster xmlserializer
- will serialize decorated
[datamember]
- if it's notpublic
visible - will not serialize unless tell ("opt-in")
- you can define order in elements serialized using
order=
attribute on[datamember]
- doesn't require parameterless constructor deserialization
Comments
Post a Comment