I want to exclude the key and __type 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 am using System.Runtime.Serialization.Json.DataContractJsonSerializer .
I had to mark types as known types, and this seems to be what pulls __type into serialization.
I do not want this in my object, how can this be done?
Without using the KnownType attribute in a class with a DataContract, it will work, but without it in this class I get all kinds of exceptions for these classes of class classes.
source share