deserialize object

Oct 10, 2011 at 11:10 AM

hi, I have to convert this json  structure in a my object:

{
"nb_results":459,
"0":{
"id":1384045,
"title":"scientist with test tube radiant gradient bg",
"creator_name":"Jose Gil",
"creator_id":6537,
"thumbnail_url":"http:\/\/static-p1.fotolia.com\/jpg\/00\/01\/38\/40\/110_F_1384045_waKUmRkPuVSQSK9T4lDNc5YvkqSp4x.jpg",
"thumbnail_html_tag":"",
"thumbnail_width":81,
"thumbnail_height":110,
"licences":[
{
"name":"M",
"price":1
},
{
"name":"L",
"price":2
},
{
"name":"X",
"price":50
}
]
},
"1":{
"id":1247723,
"title":"antique tube tester",
"creator_name":"James Steidl",
"creator_id":140159,
"thumbnail_url":"http:\/\/static-p2.fotolia.com\/jpg\/00\/01\/24\/77\/110_F_1247723_MB9BPAu0TMbhI2UEUNCQKCRpvXdEyR.jpg",
"thumbnail_html_tag":"",
"thumbnail_width":74,
"thumbnail_height":110,
"licences":[
{
"name":"M",
"price":1
},
{
"name":"L",
"price":2
},
{
"name":"XL",
"price":3
},
{
"name":"X",
"price":20
}
]
}
}

 

I have tried to declare a structure like this , but it doesn't work : Can you help me ?

Thaks Roberto

p

       public struct License
        {
            public int price;
            public string name;
        }

        public struct LiaSearchResult
        {
            public int nb_results;
            public LiaResult[] risultati;
        }
        public struct LiaResult
        {
           
            public int id;
            public string title;
            public int creator_id;
            public string creator_name;
            public string thumbnail_url;
            public string thumbnail_html_tag;
            public int thumbnail_width;
            public int thumbnail_height;
            public License[] licenze ;
            public int nb_views;
            public int nb_downloads;
            public string keywords;          
        }