custom deserialization

Nov 23, 2011 at 11:00 AM

I'm new with this library and I have a question. 

I have to read some json data from server and it looks like:

 

{

Config:[array of objects],

Products:[array of products],

...

 

}

But Config array is build of objects that are very different each. So I'm trying to use

JsonConvert.DeserializeObject<ReadObject>(stream);

class ReadObject{

Config config {get; set;}

IList<Product> products {get;set;}

.....

}.

It works great out of box for Products list but I want to use custom node parsing for Config object cause it demands specific parsing. 

The question is how I can control parsing in Config class? Is there any interface that I should implement to get on some raw JsonObject data? Can someone please point me out?

thanks!

Nov 29, 2011 at 8:27 PM

Probably this post will help you: http://stackoverflow.com/questions/8254503/json-net-how-to-pass-arguments-to-a-non-default-constructor/8312048#8312048