Home JsonPatch Class
JsonPatch Class
Cancel

JsonPatch Class

Namespace: Json.Patch

Inheritance: JsonPatch 🡒 object

Implemented interfaces:

  • IEquatable<JsonPatch>

Models a JSON Patch document.

Properties

NameTypeSummary
OperationsIReadOnlyList<PatchOperation>Gets the collection of operations.

Constructors

JsonPatch(params PatchOperation[] operations)

Creates a new instance of the Json.Patch.JsonPatch class.

Declaration

1
public JsonPatch(params PatchOperation[] operations)
ParameterTypeDescription
operationsparams PatchOperation[]The collection of operations.

JsonPatch(IEnumerable<PatchOperation> operations)

Creates a new instance of the Json.Patch.JsonPatch class.

Declaration

1
public JsonPatch(IEnumerable<PatchOperation> operations)
ParameterTypeDescription
operationsIEnumerable<PatchOperation>The collection of operations.

Methods

Apply(JsonNode source)

Applies the patch to a JSON document.

Declaration

1
public PatchResult Apply(JsonNode source)
ParameterTypeDescription
sourceJsonNodeThe JSON document.

Returns

A result object containing the output JSON and a possible error message.

Equals(JsonPatch other)

Indicates whether the current object is equal to another object of the same type.

Declaration

1
public bool Equals(JsonPatch other)
ParameterTypeDescription
otherJsonPatchAn object to compare with this object.

Returns

true if the current object is equal to theother parameter; otherwise, false.

Equals(object obj)

Determines whether the specified object is equal to the current object.

Declaration

1
public override bool Equals(object obj)
ParameterTypeDescription
objobjectThe object to compare with the current object.

Returns

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

Declaration

1
public override int GetHashCode()

Returns

A hash code for the current object.

Contents