jsonfx/jsonfx — Issue #17: ExtensionDataObject
Author: esbenbach
Created: 2012-01-25 07:27:22+00:00
State: open

Using the JsonReader with the DataContractResolverStrategy the serializers does not seem to serialize into the ExtensionDataObject if the contract implements IExtensibleDataObject.

In terms of code:

```c#
using (StreamReader reader = new StreamReader("some stream here"))
{
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(SomeContract));
var serializedItem = (SomeContract)serializer.ReadObject(reader.BaseStream);

JsonReader jsonReader = new JsonReader(new DataReaderSettings(new DataContractResolverStrategy()));
var otherSerializedItem = jsonReader.Read(reader.ReadToEnd());
}
```

The serializedItem and otherSerializedItem will not be the same as the serializedItem will have all the unknown values in the ExtensionDataObject defined in the contract.

I don't know if this would be a desired feature, an option to the resolver strategy or whatnot - but I find it odd that the two produces different results (and I for one finds it a usefull feature).