vurprocess.blogg.se

C# convert xml to json
C# convert xml to json





c# convert xml to json

In my current case, I do not like this way: Then I use a wrapper class: public class PersonRoot Usually, I do not have to care about, because I'm only using JSON documents. Unfortunately, it's not straight forward to have a root property in JSON. Like the required XML root node, the JSON document shall also have a root property. To ensure that XML-attributes and data types can be used, a C# DTO is required. Data types have to be specified (string, int, boolean.).JSON-Document has to contain a root property.The solution will be provided as an Azure Function.Īdditional requirements which have to be met: If the XML is transformed back into JSON, the initial JSON has to equal the transformed back JSON. Transforming data from JSON to XML and XML to JSON with C# Table of ContentsĢ Data Transfer Object (DTO) and data samplesĪ JSON document has to be transformed into XML.







C# convert xml to json