How to serialize class type but not the namespace to a Json string using DataContractJsonSerializer

后端 未结 6 1566
太阳男子
太阳男子 2021-02-05 21:17

I\'m trying to serialize a class hierarchy to a Json string using DataContractJsonSerializer, in a WCF service. the default behaviour for serializing a derived clas

6条回答
  •  温柔的废话
    2021-02-05 21:31

    Adding the namespace parameter to the data contract does the trick. [DataContract(Namespace = "")]

提交回复
热议问题