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