I use JsonPatchDocument to update my objects, this works well if JSON looks like this
[ { "op": "replace", "path": "/leadStatus", "value": "2" }, ]
When I create an object, it transforms it using the Operations node
var patchDoc = new JsonPatchDocument<LeadTransDetail>(); patchDoc.Replace("leadStatus", statusId); { "Operations": [ { "value": 2, "path": "/leadStatus", "op": "replace", "from": "string" } ] }
if the JSON object looks like the fix is โโnot working. I believe that I need to convert it using
public static void ConfigureApis(HttpConfiguration config) { config.Formatters.Add(new JsonPatchFormatter()); }
And that should figure it out, the problem is that I'm using the .net kernel, so I'm not 100% sure where to add JsonPatchFormatter
source share