is there object generator working on JSON ? (just like XSDObjectGen.exe)
-
22-09-2019 - |
Question
I have to serialize & desserialize json data.
if the data type was XSD, I am able to create class by using XSDObjectGen.exe
But ,
the data type I have to serialize is 'JSON'.
Is there any good way to generate class for serialize & deserialize ?
Solution
There is a JSONDataSerializer
, but it is some obscure assembly. (Maybe the ASP.NET extensions?)
OTHER TIPS
using System.Web.Script.Serialization;
...
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
string payload = javaScriptSerializer.Serialize(myObject);
//or
string payload = javaScriptSerializer.Serialize(new object[] { myObject.Id });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow