我有被序列化为 JSON 的数据,然后必须将其添加到 SharedVariable 中的 Dynamics PluginExeutionContext 中。问题是 JSON 内容作为字符串传递,不能在接收器的另一端解析为 JSON。
现在是这样通过的:
"SharedVariables": [
"key": "Telemetry_Log",
"value": "JsonContent"
},
]
我需要的是没有像这样的双引号的“JsonContent”
"SharedVariables": [
"key": "Telemetry_Log",
"value": JsonContent
},
]
首先,我将数据序列化为 JSON 并将字符串传递给上下文,如下所示:
_executionContext.SharedVariables.Add(TelemetryLogSharedVariables.CustomUserLog.GetDescription(), _loggerContainerUser.ConvertToJson()
第二次尝试是返回 CRM 实体列表,希望 Dynamics 将其序列化。
最后一次尝试是将 JSON 字符串转换为对象:
_executionContext.SharedVariables.Add(TelemetryLogSharedVariables.CustomUserLog.GetDescription(), (Object)_loggerContainerUser.ConvertToJson()
没有任何效果,我总是用双引号得到 JSON 字符串。
有人有建议吗?