Share via


ObjectAdapter.Copy(Operation, Object) Method

Definition

The "copy" operation copies the value at a specified location to the target location.

The operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to copy the value from.

The "from" location MUST exist for the operation to be successful.

For example:

{ "op": "copy", "from": "/a/b/c", "path": "/a/b/e" }

This operation is functionally identical to an "add" operation at the target location using the value specified in the "from" member.

Note: even though it's the same functionally, we do not call add with the value specified in from for performance reasons (multiple checks of same requirements).

public:
 virtual void Copy(Microsoft::AspNetCore::JsonPatch::Operations::Operation ^ operation, System::Object ^ objectToApplyTo);
public void Copy (Microsoft.AspNetCore.JsonPatch.Operations.Operation operation, object objectToApplyTo);
abstract member Copy : Microsoft.AspNetCore.JsonPatch.Operations.Operation * obj -> unit
override this.Copy : Microsoft.AspNetCore.JsonPatch.Operations.Operation * obj -> unit
Public Sub Copy (operation As Operation, objectToApplyTo As Object)

Parameters

operation
Operation

The copy operation.

objectToApplyTo
Object

Object to apply the operation to.

Implements

Applies to