Classes From XML Schema
This is the CMD to generate the classes from the schema
SET XsdPath=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools
"%XsdPath%\xsd.exe" YOUR-SCHEMA1.xsd YOUR-SCHEMA1.xsd /classes /namespace:YOUR-NAME-SPACE
SET XsdPath=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools
"%XsdPath%\xsd.exe" YOUR-SCHEMA1.xsd YOUR-SCHEMA1.xsd /classes /namespace:YOUR-NAME-SPACE
This is the reference: https://msdn.microsoft.com/en-us/library/x6c1kb0s(v=vs.110).aspx
Another good example: https://blogs.msdn.microsoft.com/yojoshi/2011/05/14/auto-generating-entity-classes-with-xsd-exe-for-xml-serialization-and-de-serialization/
Then for mapping the class you can use: https://github.com/AutoMapper/AutoMapper
You can install it as a nuget package
You can install it as a nuget package
Comments
Post a Comment