When building a response in WCF (json), im pretty sure it's not possible to use completely dynamic objects, but just wanted to double check here first.
An ideal response would look something like:
"userTypes" :
{
"BartSimpson" :
{
"url" : "foo",
"desc" : "bar"
},
"LisaSimpson" :
{
"url" : "foo",
"desc" : "bar"
}
}
In 'compiled' code, the above could be performed by the following architecture (slightly pseudocode):
public class Character{
string url {get;set;}
string desc{get;set;}
}
public class UserTypes{
public Character BartSimpson{get;set;}
public Character LisaSimpson{get;set;}
}
But my main goal is that BartSimpson
and LisaSimpson
are not 'compiled' so I could have any number of Character
classes, with any name / identifer in the response.