I have Rest Service API, the Contract is
[OperationContract]
[WebInvoke(
Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/CreateCustomActivity?token={authToken}"
)]
ProcessStatus CreateCustomActivity(string authToken, ProspectActivityCompound activity);
ProspectActivityCompound, dataobject, has a property ActivityFields of datatype
Dictionary<string,string>
This is my requestData
{
"RelatedProspectId": "2cd12345-1130-11e6-be13-06c7eb5c1234",
"ActivityEvent": 156,
"ActivityNote": "asdasdasd",
"ActivityDate": "/Date(1468394160000)/",
"ActivityDateTime": "2016-07-13 19:16:00",
"Score": 9,
"ActivityFields": {
"Custom_1": "1234",
"Custom_2": "asdf",
"Custom_3": "dfg",
"Custom_4": "qwe",
}
}
I know that I can use this to get the data in dictionary.
"ActivityFields": [
{"Key":"Custom_1", "Value":"1234"},
{"Key":"Custom_2", "Value":"fgh"},
{"Key":"Custom_3", "Value":"wer"},
{"Key":"Custom_4", "Value":"sdfs"}
]
I want ActivityFields to come as Key Value pair, but right now its coming as null. The JSON format should be the same, so can anyone give me a method to receive this JSON as Key Value pair.