Generate C# class from XML

后端 未结 8 1751
青春惊慌失措
青春惊慌失措 2020-11-22 05:19

Can I generate a C# class from an XML file?

8条回答
  •  被撕碎了的回忆
    2020-11-22 05:48

    At first I thought the Paste Special was the holy grail! But then I tried it and my hair turned white just like the Indiana Jones movie.

    But now I use http://xmltocsharp.azurewebsites.net/ and now I'm as young as ever.

    Here's a segment of what it generated:

    namespace Xml2CSharp
    {
        [XmlRoot(ElementName="entry")]
        public class Entry {
            [XmlElement(ElementName="hybrisEntryID")]
            public string HybrisEntryID { get; set; }
            [XmlElement(ElementName="mapicsLineSequenceNumber")]
            public string MapicsLineSequenceNumber { get; set; }
    

提交回复
热议问题