Answer the question
In order to leave comments, you need to log in
How to create a dynamic class from deserialized XML or JSON in C#?
Is it possible to create a dynamic class in C# by deserialized string:
JSON
{"K":10,"Sums":[12.0,45678.0,12.0,512.0],"Muls":[3,5,10,12,45]}
XML
pastebin.com/MuSHLSH0
Answer the question
In order to leave comments, you need to log in
I will answer for JSON. If I understand everything correctly, then I do it using Json.NET in this way:
For XML, here is stackoverflow.com/questions/13171525/converting-xm... and here: stackoverflow.com/questions/13704752/deserialize-x...
If only an object of an anonymous class. Do you have generic XML/JSON format or random/unknown? If typical, then you can make your own class and describe serialization / deserialization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question