C# 更改在ServiceContract中序列化IDictionary的方式
但实际响应的格式如下所示:C# 更改在ServiceContract中序列化IDictionary的方式,c#,.net,json,servicecontract,C#,.net,Json,Servicecontract,但实际响应的格式如下所示: {"Name":"name","Attributes":{"foo":"bar"}} 我喜欢第一种变体。如何配置或控制序列化以实现此目的 {"Name":"name","Attributes":{"foo":"bar"}} {"Name":"name","Attributes":[{"Key":"foo","Value":"bar"}]}
{"Name":"name","Attributes":{"foo":"bar"}}
我喜欢第一种变体。如何配置或控制序列化以实现此目的
{"Name":"name","Attributes":{"foo":"bar"}}
{"Name":"name","Attributes":[{"Key":"foo","Value":"bar"}]}