简体   繁体   English

序列化/反序列化ODATA xml到C#对象

[英]Serialize/Deserialize ODATA xml to C# object

I need to convert the ODATA XML to C# Object and back Sample xml. 我需要将ODATA XML转换为C#Object并返回Sample xml。

 <entry xml:base="abc.com:8000"
       xmlns=w3.org/2005/Atom"
       xmlns:m="schemas.microsoft.com/ado/2007/08/dataservices/metadata"
       xmlns:d="schemas.microsoft.com/ado/2007/08/dataservices"
    >
       <id>abc.com:8000</id>
       <title type="text">MaintNotifSet</title>
       <content type="application/xml">
          <m:properties>
             <d:NotifType>MA</d:NotifType>
             <d:Dscid>...dsc id...</d:Dscid>
          </m:properties>
       </content>
    </entry>

Are there any libraries exist to help the parsing. 是否存在任何库来帮助解析。 Please throw some light. 请多点亮一点。

Use XSD command tool inside visual studio installation 在visual studio安装中使用XSD命令工具

XSD MyXml.xml

this will generate MyXxl.XSD then 这将生成MyXxl.XSD

XSD /c myxml.xsd

this will generate myxml.c which contains your classes 这将生成包含您的类的myxml.c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM