I have classes like these:
class MyDate
{
int year, month, day;
}
class Lad
{
string firstName;
string lastName;
MyDate dateOfBirth;
}
And I would like to turn a Lad object into a JSON string like this:
{
"firstName":"Rohit",
"lastName":"Sharma",
"dateOfBirth":
{
"year":"1901",
"month":"4",
"day":"30"
}
}
I discovered this link, but.NET 4 doesn't support the namespace it uses. JSON.NET is another option I've heard about, but I don't like the idea of requiring external DLL files, and their website currently appears to be unavailable.
Exist any other choices except writing a JSON string writer by hand?