Class JsonPatchService
Provides functionality to apply and manage JSON Patch operations on resources.
Inheritance
object
Namespace: Umbraco.Cms.Api.Management.Services
Assembly: Umbraco.Cms.Api.Management.dll
Syntax
[Obsolete("Use the custom patch engine (IDocumentPatcher) instead. JsonPatch.Net dependency is being removed. Scheduled for removal in Umbraco 19.")]
public class JsonPatchService : IJsonPatchService
Constructors
View SourceJsonPatchService(IJsonSerializer)
Initializes a new instance of the JsonPatchService class with the specified JSON serializer.
Declaration
public JsonPatchService(IJsonSerializer jsonSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonSerializer | jsonSerializer | The IJsonSerializer instance used for JSON serialization and deserialization. |
Methods
View SourcePatch(JsonPatchViewModel[], object)
Applies a sequence of JSON patch operations to a specified object.
Declaration
public PatchResult? Patch(JsonPatchViewModel[] patchViewModel, object objectToPatch)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonPatchViewModel[] | patchViewModel | An array of JsonPatchViewModel representing the JSON patch operations to apply. |
| object | objectToPatch | The target object to which the patch operations will be applied. |
Returns
| Type | Description |
|---|---|
| PatchResult | A Json.Patch.PatchResult indicating the outcome of the patch operation, or |