JamesNK/Newtonsoft.Json — pull request #33 by jamietre (2012-07-19 20:39:25+00:00)
Title: Add support for custom dynamic object types

I revised `ExpandoObjectConverter` to be aware of `IDynamicMetaObjectProvider` implementations other than `ExpandoObject`. The framework `ExpandoObject` is problematic because it's sealed. In my projects I frequently use a custom implementation that permits accessing missing members directly and just returns a special value or null to mimic behavior of a Javascript object. I included a basic implementation like this for the test.

As far as I can tell there was no way to have JSON.NET deserialize anything other than the outermost level of a JSON structure into a custom dynamic type, any inner objects would become `JObject` types. These changes will test an object for inheriting `IDictionary` and `IDynamicMetaObjectProvider` instead of just testing for being an `ExpandoObject`, and use create instances of the type provided instead.