gpt4 book ai didi

c# - 从类、代码生成 XSD

转载 作者:太空宇宙 更新时间:2023-11-03 23:39:39 24 4
gpt4 key购买 nike

我想编写基于 C# 类创建 XSD 的代码。

我无法找到如何在不使用 XSD.exe 的情况下执行此操作的信息。示例类:

[XmlRoot("Sync")]
public class SyncFileSettings : ISyncSettings
{
public SyncFileSettings(int pingIntervalSec, bool useCompression)
{
PingIntervalSec = pingIntervalSec;
UseCompression = useCompression;
}

public int PingIntervalSec { get; set; }
public bool UseCompression { get; private set; }
}

最佳答案

how to generate xsd from class in code

Using XSD.exe .

without XSD.exe?

为什么?然后你将不得不重新发明轮子,或者use a library .

关于c# - 从类、代码生成 XSD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29558524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com