rest api c# json patch
[
{ "op": "add", "path": "/foo", "value": "bar"},
{ "op": "replace", "path": "/baz", "value": "boo" }
]
rest api c# json patch
[
{ "op": "add", "path": "/foo", "value": "bar"},
{ "op": "replace", "path": "/baz", "value": "boo" }
]
rest api c# json patch
JsonPatchDocument<SimpleDTO> patchDoc = new JsonPatchDocument<SimpleDTO>();
// add "4" to a list of integers at position 0
patchDoc.Add<int>(o => o.IntegerList, 4, 0);
// add "5" to the end of that list
patchDoc.Add<int>(o => o.IntegerList, 5);
// remove the current value of StringProperty
patchDoc.Remove<string>(o => o.StringProperty);
// remove the value at position two from a list of integers
patchDoc.Remove<int>(o => o.IntegerList, 2);
// replace StringProperty with value "B"
patchDoc.Replace<string>(o => o.StringProperty, "B");
// replace value at position 4 in a list of integers with value 5
patchDoc.Replace<int>(o => o.IntegerList, 5, 4);
//copy value IntegerValue to position 0 in a list of integers
patchDoc.Copy<int>(o => o.IntegerValue, o => o.IntegerList, 0);
// move the integers at position 0 in a list of integers to position 1 in that same list
patchDoc.Move<int>(o => o.IntegerList, 0, o => o.IntegerList, 1);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us