Converting XML to a dynamic C# object

后端 未结 4 1787
孤街浪徒
孤街浪徒 2020-11-28 04:32

I\'ve used the following C# code to convert a string of JSON data to a dynamic object using the JSON.Net framework:

// Creates a dynamic .Net object represen         


        
4条回答
  •  [愿得一人]
    2020-11-28 05:09

    Cinchoo ETL - an open source library available to parse xml into dynamic object

    using (var p = ChoXmlReader.LoadText(xml).WithXPath("/"))
    {
        foreach (dynamic rec in p)
            Console.WriteLine(rec.Dump());
    }
    

    Checkout CodeProject article for some additional help.

    Disclaimer: I'm the author of this library.

提交回复
热议问题