With WCF, provided that you’re using the DataContractSerializer and not the NetDataContractSerializer, you have a certain degree of protection against data contract changes from the client’s perspective.
Existing contracts will still work if existing members are not removed from the data contract, which means you are free to add new members to the data contract on the server side without affecting existing clients. This gives you some backward compatibility and allows you to incrementally evolve your data contracts in a non-breaking way.
Round-tripping occurs when data passes from a new version to an old version and back to the new version of a data contract. Round-tripping guarantees that no data is lost. Enabling round-tripping makes the type forward-compatible with any future changes supported by the data contract versioning model.
To enable round-tripping your type must implement the IExtensibleDataContract interface and add the ExtensionData property of ExtensionDataObject type (see the MSDN article in the References section for an example).
It’s worth noting that the data stored in the ExtensionData property is not public retrievable and is only used by the WCF infrastructure.
And finally, to turn it off:
The round-tripping feature may be turned off, either by setting ignoreExtensionDataObject to true in the DataContractSerializer constructor or by setting theIgnoreExtensionDataObject property to true on the ServiceBehaviorAttribute. When this feature is off, the deserializer will not populate the ExtensionData property, and the serializer will not emit the contents of the property.
I’m an AWS Serverless Hero and the author of Production-Ready Serverless. I have run production workload at scale in AWS for nearly 10 years and I have been an architect or principal engineer with a variety of industries ranging from banking, e-commerce, sports streaming to mobile gaming. I currently work as an independent consultant focused on AWS and serverless.
Here is a complete list of all my posts on serverless and AWS Lambda. In the meantime, here are a few of my most popular blog posts.
- Lambda optimization tip – enable HTTP keep-alive
- You are thinking about serverless costs all wrong
- Many faced threats to Serverless security
- We can do better than percentile latencies
- I’m afraid you’re thinking about AWS Lambda cold starts all wrong
- Yubl’s road to Serverless
- AWS Lambda – should you have few monolithic functions or many single-purposed functions?
- AWS Lambda – compare coldstart time with different languages, memory and code sizes
- Guys, we’re doing pagination wrong