iextensibledataobject

XmlSerializer equivalent of IExtensibleDataObject

做~自己de王妃 提交于 2019-12-02 05:36:25
问题 With DataContracts you can derive from IExtensibleDataObject to allow round-tripping to work without losing any unknown additional data from your XML file. I can't use DataContract because I need to control the formatting of the output XML. But I also need to be able to read a future version of the XML file in the old version of the app, without losing any of the data from the XML file. e.g. XML v1: <Person> <Name>Fred</Name> </Person> XML v2: <Person> <Name>Fred</Name> <Age>42</Age> </Person

XmlSerializer equivalent of IExtensibleDataObject

我怕爱的太早我们不能终老 提交于 2019-12-02 02:20:33
With DataContracts you can derive from IExtensibleDataObject to allow round-tripping to work without losing any unknown additional data from your XML file. I can't use DataContract because I need to control the formatting of the output XML. But I also need to be able to read a future version of the XML file in the old version of the app, without losing any of the data from the XML file. e.g. XML v1: <Person> <Name>Fred</Name> </Person> XML v2: <Person> <Name>Fred</Name> <Age>42</Age> </Person> If reading an XML v2 file from v1 of my app, deserializing and serializing it again turns it into an

IExtensibleDataObject usage in clients

落爺英雄遲暮 提交于 2019-12-01 03:54:40
I have converted my web service to wcf service which has some datacontracts. As a best practice it is mentioned and advisable that the DataContracts should inherit from IExtensibleDataObject. I get the point that in case of addition or removal of datamembers, IExtensibleDataObject is helpful. But i am not able to get how will the clients access removed datamembers. Here is my code: [ServiceContract(Namespace = "http://mycompany.com/2010/08/")] public class MyWebService { [OperationContract] public Employee Add(Employee emp) { // Some Processing } } [DataContract(Name = "Employee", Namespace =

IExtensibleDataObject usage in clients

爷,独闯天下 提交于 2019-12-01 01:15:57
问题 I have converted my web service to wcf service which has some datacontracts. As a best practice it is mentioned and advisable that the DataContracts should inherit from IExtensibleDataObject. I get the point that in case of addition or removal of datamembers, IExtensibleDataObject is helpful. But i am not able to get how will the clients access removed datamembers. Here is my code: [ServiceContract(Namespace = "http://mycompany.com/2010/08/")] public class MyWebService { [OperationContract]