We have xml from a REST API and are currently handwriting POCO's for them. I vaguely recall that there were tools to do this automagically in Visual Studio.
What is the best way to generate POCO's from XML?
We have xml from a REST API and are currently handwriting POCO's for them. I vaguely recall that there were tools to do this automagically in Visual Studio.
What is the best way to generate POCO's from XML?
You can use xsd.exe to do so.
To create an xsd file:
xsd file.xml /outputdir:"C:\Temp"
To create classes from the xsd file:
xsd file.xsd /classes /outputdir:"C:\Temp"
xsd.exe might be what you are looking for.
This post shows how to make the c# class from the generated schema: https://stackoverflow.com/a/1133052/353147