I am working with wp7 and even though when I type "dynamic" in VS highlights and lets me compile and run the application, but as soon as I try to use it I get compile errors.
I read I can't use dynamic keyword and now kinda lost on how to do my json parsing(I am using json.net and restsharp but both run into the same problem if I can't use dynamic)
For example say if I use foursquare api. All json data is always returned like
{
"meta": {
"code": 200,
...errorType and errorDetail...
},
"notifications": {
...notifications...
},
"response": {
...results...
}
}
but the response will have different data. For instance it might have user data(User Class) or it might have venue data(Venue class).
The bottom line though is I am going to need a class called Response that is in a RootObject class.
But I can't have the same class name(unless I start putting them in different name spaces but not crazy about that idea).
Only other thing I can think of what sucks too is
public class RootObject
{
public Response Response { get; set; }
}
public class Response
{
public User User { get; set; }
public List<Venue> Venues { get; set; }
}
This response object will in the end have all the different classes that could come back and in reality only property in the Response object will probably be filled.
Is there a better way?