Home PatchOperation Class
PatchOperation Class
Cancel

PatchOperation Class

Namespace: Json.Patch

Inheritance: PatchOperation 🡒 object

Implemented interfaces:

  • IEquatable<PatchOperation>

Represents a single JSON Patch operation.

Properties

NameTypeSummary
FromJsonPointerGets the source path.
OpOperationTypeGets the operation type.
PathJsonPointerGets the target path.
ValueJsonNodeGets the discrete value.

Methods

Add(JsonPointer path, JsonNode value)

Creates an add operation.

Declaration

1
public static PatchOperation Add(JsonPointer path, JsonNode value)
ParameterTypeDescription
pathJsonPointerThe source path.
valueJsonNodeThe value to add.

Returns

An add operation.

Copy(JsonPointer from, JsonPointer path)

Creates an copy operation.

Declaration

1
public static PatchOperation Copy(JsonPointer from, JsonPointer path)
ParameterTypeDescription
pathJsonPointerThe target path.
fromJsonPointerThe path to the value to move.

Returns

An copy operation.

Equals(PatchOperation other)

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

Declaration

1
public bool Equals(PatchOperation other)
ParameterTypeDescription
otherPatchOperationAn object to compare with this object.

Returns

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

Equals(object obj)

Indicates whether this instance and a specified object are equal.

Declaration

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

Returns

true ifobj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

Declaration

1
public override int GetHashCode()

Returns

A 32-bit signed integer that is the hash code for this instance.

Move(JsonPointer from, JsonPointer path)

Creates an move operation.

Declaration

1
public static PatchOperation Move(JsonPointer from, JsonPointer path)
ParameterTypeDescription
pathJsonPointerThe target path.
fromJsonPointerThe path to the value to move.

Returns

An move operation.

Remove(JsonPointer path)

Creates an remove operation.

Declaration

1
public static PatchOperation Remove(JsonPointer path)
ParameterTypeDescription
pathJsonPointerThe source path.

Returns

An remove operation.

Replace(JsonPointer path, JsonNode value)

Creates an replace operation.

Declaration

1
public static PatchOperation Replace(JsonPointer path, JsonNode value)
ParameterTypeDescription
pathJsonPointerThe source path.
valueJsonNodeThe value to add.

Returns

An replace operation.

Test(JsonPointer path, JsonNode value)

Creates an test operation.

Declaration

1
public static PatchOperation Test(JsonPointer path, JsonNode value)
ParameterTypeDescription
pathJsonPointerThe source path.
valueJsonNodeThe value to match.

Returns

An test operation.

Contents