47 instantiations of JsonPatchDocument
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Converters\JsonConverterForJsonPatchDocumentOfT.cs (1)
45
return new
JsonPatchDocument
<T>(ops, options);
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (46)
IntegrationTests\ListIntegrationTest.cs (10)
25
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
44
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
65
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
94
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
116
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
181
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
222
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
244
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
329
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
355
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
IntegrationTests\NestedObjectIntegrationTest.cs (13)
27
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObjectWithNullCheck>();
47
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
69
var patchDocument = new
JsonPatchDocument
<NestedObject>();
89
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
111
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
133
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
156
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
179
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
207
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
231
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
251
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
274
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
305
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
JsonPatchDocumentGetPathTest.cs (7)
16
var patchDocument = new
JsonPatchDocument
<SimpleObjectWithNestedObject>();
29
var patchDocument = new
JsonPatchDocument
<int[]>();
42
var patchDocument = new
JsonPatchDocument
<Dictionary<string, int>>();
55
var patchDocument = new
JsonPatchDocument
<SimpleObject>();
68
var patchDocument = new
JsonPatchDocument
<SimpleObject>();
81
var patchDocument = new
JsonPatchDocument
<NestedObjectWithDerivedClass>();
94
var patchDocument = new
JsonPatchDocument
<SimpleObject>();
JsonPatchDocumentJObjectTest.cs (10)
19
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
35
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
49
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
67
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
82
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
98
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
115
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
131
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
148
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
164
var patch = new
JsonPatchDocument
<ObjectWithJObject>();
JsonPatchDocumentJsonPropertyAttributeTest.cs (2)
16
var patchDocument = new
JsonPatchDocument
<JsonPropertyObject>();
47
var patchDocument = new
JsonPatchDocument
<JsonPropertyWithNoPropertyName>();
JsonPatchDocumentTest.cs (4)
100
var doc = new
JsonPatchDocument
<Organization>();
120
var patchDocTyped = new
JsonPatchDocument
<SimpleObject>();
150
var patchDocument = new
JsonPatchDocument
<SimpleObject>();
247
var document = new
JsonPatchDocument
<SimpleObject>();
116 references to JsonPatchDocument
Microsoft.AspNetCore.JsonPatch.SystemTextJson (54)
Converters\JsonConverterForJsonPatchDocumentOfT.cs (5)
12
internal sealed class JsonConverterForJsonPatchDocumentOfT<T> : JsonConverter<
JsonPatchDocument
<T>>
18
public override
JsonPatchDocument
<T> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
20
if (typeToConvert != typeof(
JsonPatchDocument
<T>))
22
throw new ArgumentException(Resources.FormatParameterMustMatchType(nameof(typeToConvert), nameof(
JsonPatchDocument
<T>)), nameof(typeToConvert));
53
public override void Write(Utf8JsonWriter writer,
JsonPatchDocument
<T> value, JsonSerializerOptions options)
Converters\JsonPatchDocumentConverterFactory.cs (1)
15
(typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(
JsonPatchDocument
<>));
JsonPatchDocumentOfT.cs (48)
55
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
56
public
JsonPatchDocument
<TModel> Add<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
76
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
77
public
JsonPatchDocument
<TModel> Add<TProp>(
99
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
100
public
JsonPatchDocument
<TModel> Add<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
118
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
119
public
JsonPatchDocument
<TModel> Remove<TProp>(Expression<Func<TModel, TProp>> path)
134
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
135
public
JsonPatchDocument
<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path, int position)
152
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
153
public
JsonPatchDocument
<TModel> Remove<TProp>(Expression<Func<TModel, IList<TProp>>> path)
171
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
172
public
JsonPatchDocument
<TModel> Replace<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
192
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
193
public
JsonPatchDocument
<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path,
213
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
214
public
JsonPatchDocument
<TModel> Replace<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
233
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
234
public
JsonPatchDocument
<TModel> Test<TProp>(Expression<Func<TModel, TProp>> path, TProp value)
254
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
255
public
JsonPatchDocument
<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path,
275
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
276
public
JsonPatchDocument
<TModel> Test<TProp>(Expression<Func<TModel, IList<TProp>>> path, TProp value)
295
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
296
public
JsonPatchDocument
<TModel> Move<TProp>(
318
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
319
public
JsonPatchDocument
<TModel> Move<TProp>(
342
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
343
public
JsonPatchDocument
<TModel> Move<TProp>(
367
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
368
public
JsonPatchDocument
<TModel> Move<TProp>(
392
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
393
public
JsonPatchDocument
<TModel> Move<TProp>(
415
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
416
public
JsonPatchDocument
<TModel> Move<TProp>(
437
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
438
public
JsonPatchDocument
<TModel> Copy<TProp>(
460
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
461
public
JsonPatchDocument
<TModel> Copy<TProp>(
484
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
485
public
JsonPatchDocument
<TModel> Copy<TProp>(
509
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
510
public
JsonPatchDocument
<TModel> Copy<TProp>(
534
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
535
public
JsonPatchDocument
<TModel> Copy<TProp>(
557
/// <returns>The <see cref="
JsonPatchDocument
{TModel}"/> for chaining.</returns>
558
public
JsonPatchDocument
<TModel> Copy<TProp>(
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (61)
IntegrationTests\ListIntegrationTest.cs (10)
25
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
44
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
65
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
94
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
116
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
181
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
222
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
244
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
329
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
355
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
IntegrationTests\NestedObjectIntegrationTest.cs (15)
27
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObjectWithNullCheck>();
47
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
51
var
deserialized = JsonSerializer.Deserialize<
JsonPatchDocument
<SimpleObjectWithNestedObject>>(serialized);
69
var
patchDocument = new JsonPatchDocument<NestedObject>();
89
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
111
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
133
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
156
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
179
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
207
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
231
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
251
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
274
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
305
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
JsonPatchDocumentGetPathTest.cs (7)
16
var
patchDocument = new JsonPatchDocument<SimpleObjectWithNestedObject>();
29
var
patchDocument = new JsonPatchDocument<int[]>();
42
var
patchDocument = new JsonPatchDocument<Dictionary<string, int>>();
55
var
patchDocument = new JsonPatchDocument<SimpleObject>();
68
var
patchDocument = new JsonPatchDocument<SimpleObject>();
81
var
patchDocument = new JsonPatchDocument<NestedObjectWithDerivedClass>();
94
var
patchDocument = new JsonPatchDocument<SimpleObject>();
JsonPatchDocumentJObjectTest.cs (10)
19
var
patch = new JsonPatchDocument<ObjectWithJObject>();
35
var
patch = new JsonPatchDocument<ObjectWithJObject>();
49
var
patch = new JsonPatchDocument<ObjectWithJObject>();
67
var
patch = new JsonPatchDocument<ObjectWithJObject>();
82
var
patch = new JsonPatchDocument<ObjectWithJObject>();
98
var
patch = new JsonPatchDocument<ObjectWithJObject>();
115
var
patch = new JsonPatchDocument<ObjectWithJObject>();
131
var
patch = new JsonPatchDocument<ObjectWithJObject>();
148
var
patch = new JsonPatchDocument<ObjectWithJObject>();
164
var
patch = new JsonPatchDocument<ObjectWithJObject>();
JsonPatchDocumentJsonPropertyAttributeTest.cs (2)
16
var
patchDocument = new JsonPatchDocument<JsonPropertyObject>();
47
var
patchDocument = new JsonPatchDocument<JsonPropertyWithNoPropertyName>();
JsonPatchDocumentTest.cs (17)
66
var
deserialized = JsonSerializer.Deserialize<
JsonPatchDocument
<SimpleObject>>(serialized);
100
var
doc = new JsonPatchDocument<Organization>();
120
var
patchDocTyped = new JsonPatchDocument<SimpleObject>();
150
var
patchDocument = new JsonPatchDocument<SimpleObject>();
161
var
deserialized = JsonSerializer.Deserialize<
JsonPatchDocument
<SimpleObject>>(serialized);
164
Assert.IsType<
JsonPatchDocument
<SimpleObject>>(deserialized);
195
var
deserialized
196
= JsonSerializer.Deserialize<
JsonPatchDocument
<SimpleObject>>(serialized, options);
222
var
docSuccess = DeserializePatchDocumentWithNamingPolicy(json, JsonNamingPolicy.CamelCase);
223
var
docFail = DeserializePatchDocumentWithNamingPolicy(json, JsonNamingPolicy.KebabCaseLower);
237
private static
JsonPatchDocument
<SimpleObject> DeserializePatchDocumentWithNamingPolicy(string json, JsonNamingPolicy policy)
241
var
docSuccess = JsonSerializer.Deserialize<
JsonPatchDocument
<SimpleObject>>(json, compatibleSerializerOption);
247
var
document = new JsonPatchDocument<SimpleObject>();
256
return JsonSerializer.Serialize<
JsonPatchDocument
<SimpleObject>>(document, jsonSerializerOptions);
Sample (1)
Endpoints\MapSchemasEndpoints.cs (1)
40
schemas.MapPatch("/json-patch", (
JsonPatchDocument
<ParentObject> patchDoc) => Results.NoContent());