我有一个WCF终结就是喜欢这样的:
I have a WCF endpoint that is like such:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json, UriTemplate = "")]
Stream DoWork(Dictionary<string, string> items);
为了通过什么我的服务,我要组织我的JSON像这样的:
In order to pass anything to my service, I have to structure my JSON like such:
{"items":[{"Key":"random1","Value":"value1"}, {"Key":"random2","Value":"value2"}]}
我真正想要的样子是这样的:
What I actually want it to look like is this:
{"items":{"random1":"value1","random2":"value2"}}
有没有办法做到这一点?
Is there any way to accomplish this?
您将不得不编写您自己的包装。
You will have to write your own wrapper.