Jaxb equivalent in C#(C# 中的 Jaxb 等效项)
问题描述
在 Java 中使用 JAXB 很容易从 xml 模式文件生成一组 Java 类,符合该模式的 xml 可以反序列化为.
Using JAXB in Java it is easy to generate from a xml schema file a set of Java classes that xml conforming to that schema can be deserialized to.
是否有一些 C# 等效于 JAXB?我知道 Linq 可以序列化和反序列化与 xml 文件之间的类.但是如何从 xml 模式文件生成 C# 类,然后将这些类与 linq 一起使用?
Is there some C# equivalent of JAXB? I know that Linq can serialize and deserialize classes to/from xml files. But how can I generate C# classes from xml schema file and then use this classes with linq?
推荐答案
如果您使用的是 Visual Studio, 试试 XML 架构定义工具.它采用您的模式定义并生成 C# 类——或者它可以采用另一种方式并从类中生成模式定义.它还有许多其他与 XML 相关的转换.
If you're using Visual Studio, try the XML Schema Definition Tool. It takes your schema definitions and produces C# classes -- or it can go the other way and produce schema definitions from classes. It also has a number of other XML-related transformations.
这篇关于C# 中的 Jaxb 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 中的 Jaxb 等效项


- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- C# 中多线程网络服务器的模式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01