Search Results for

    Show / Hide Table of Contents
    View Source

    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 Source

    JsonPatchService(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 Source

    Patch(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 null if the patch could not be applied.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX