Feature request: Anonymously-deserialized objects as plain ExpandoObject

Dec 20, 2012 at 10:05 AM

In some of my projects, both home and professional ones, I tend to work with dynamic DTOs. That is, I don't have actual classes for data exchange between layers.

For that reason, when I deserialize JSON using JSON.NET I get a JObject and it has dynamically-accessible properties to the whole deserialized object.

But I believe that for such cases, it would be great to have some flag like "SerializeIntoExpando" or something like that in order to let JSON.NET natively deserialize JSON into plain ExpandoObject (without JSON.NET specific objects like JObject, JArray....) where its properties are just CLR types.

A long time ago I did something like that for my own developments but I've not implemented it recursively. I mean that declared properties are using CLR types, but associatios are JSON.NET specific types yet.

Thank you and keep doing!

Coordinator
Dec 25, 2012 at 8:20 AM

ExpandoObjectConverter

Dec 25, 2012 at 12:02 PM

James, thank you.

I didn't know about the ExpandoObjectConverter.

Very nice!

Merry xmas!