This is a mirror of official site: http://jasper-net.blogspot.com/

Versioning in WCF Data Contract Part #1: Adding New Members

| Sunday, November 7, 2010
clip_5F00_image009_5F00_thumb_5F00_64159C23.jpg

DataContract versioning requires when some modification has been done to the existing DataContract exposed to the client from the service or vice versa. If either service or client is changing the schema of DataContract exposed then new version of DataContract come into action and both party involved in communication should be able to accommodate the changes done in the DataContract.

The scenario causes for new version of DataContract is as below,

Missing a member from existing DataContract .
Adding a new member to existing DataContract.
Round Tripping
In this article we will explore New Member scenarios

Adding a New Member to existing DataContract

This is most common changes we do to give new version to DataContract.

For example we have a DataContract through which we are exposing Product custom class to the client

Product.cs
[DataContract]
publicclassProduct
{
   [DataMember(Order = 1)]
   publicstringProductNumber;
   [DataMember(Order = 2)]
   publicstringProductName;
   [DataMember(Order = 3)]
   publicstringProductPrice;
}

Read more: Beyond Relational

Posted via email from .NET Info

0 comments: