How to deserialize this JSON...

Dec 7, 2008 at 7:20 PM
I'm trying to create a class representation for the following JSON object so I can deserialize it:

{"Id":null,
"division":null,
"status":null,
"data":{"names":{111111:{"firstName":"winston","lastName":"peters"}, 111112:{"firstName":"helen","lastName":"clark"}}}}

The part I am stuck on is the "data" property.  I've tried:

class Data
{
     public List<Names> names { get; set; }
}

class Names
{
    public string firstName{ get; set; }
    public string lastName { get; set; }
}

I get the following error:

Could not find member '111111' on object of type 'RuntimeType'



Dec 7, 2008 at 8:39 PM
Found the answer myself:

class Data
{
     public Dictionary<int, Names> names { get; set; }
}