This project has moved and is read-only. For the latest updates, please go here.

Question about Anonymous Type deserialization

Dec 17, 2008 at 12:14 AM
I have the following JSON:

service: '/ServiceInvoker',
params: { 
Service: 'MyService',
  Method: 'Find', 
Parameters: [{
QueryString: '1',
Criteria: '',
  Page: 0,
PageSize: 15 
and i want to serialize this to my class

    public class ServiceRequest
        public string Service { get; set; }

        public string Method { get; set; }

        public object[] Parameters { get; set; }

my problem is that this is intended as a generic purpose service component, and the property Parameters of ServiceRequest can be of any type, so this is when i come into problems, JavaScriptConvert.DeserializeObject throws the error

"Could not find member 'QueryString' on object of type 'RuntimeType'"

my quiestion is, is it posible to deserialize an icoming JSON an anonymous type that i dont know at the time of the deserialization??