views:

15

answers:

0

I want to exclude the __type Key and Value from my serialization:

{"__type":"Entity:#Runtime.DataBus","Children":[],"Fields":[{"Key":"field1","Value":"10"},{"Key":"fieldString1","Value":"field1 init"},{"Key":"fieldString2","Value":"field2 init"}],"Name":"Entity1"}

I'm using the System.Runtime.Serialization.Json.DataContractJsonSerializer.

I've had to mark the Types as KnownTypes and it appears to be this that's pulling the __type into the serialization.

I do not want it in my object, how can this be done?

Without using the KnownType attribute on the class with the DataContract it would work but without it in this class I get all sorts of exceptions on this classes member's Types.