C# Class Microsoft.AspNetCore.JsonPatch.JsonPatchDocument

Inheritance: IJsonPatchDocument
Mostra file Open project: aspnet/JsonPatch Class Usage Examples

Private Properties

Property Type Description
IJsonPatchDocument IList

Public Methods

Method Description
Add ( string path, object value ) : JsonPatchDocument

Add operation. Will result in, for example, { "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] }

ApplyTo ( object objectToApplyTo ) : void

Apply this JsonPatchDocument

ApplyTo ( object objectToApplyTo, Action logErrorAction ) : void

Apply this JsonPatchDocument

ApplyTo ( object objectToApplyTo, IObjectAdapter adapter ) : void

Apply this JsonPatchDocument

Copy ( string from, string path ) : JsonPatchDocument

Copy the value at specified location to the target location. Willr esult in, for example: { "op": "copy", "from": "/a/b/c", "path": "/a/b/e" }

JsonPatchDocument ( ) : System
JsonPatchDocument ( List operations, IContractResolver contractResolver ) : System
Move ( string from, string path ) : JsonPatchDocument

Removes value at specified location and add it to the target location. Will result in, for example: { "op": "move", "from": "/a/b/c", "path": "/a/b/d" }

Remove ( string path ) : JsonPatchDocument

Remove value at target location. Will result in, for example, { "op": "remove", "path": "/a/b/c" }

Replace ( string path, object value ) : JsonPatchDocument

Replace value. Will result in, for example, { "op": "replace", "path": "/a/b/c", "value": 42 }

Private Methods

Method Description
IJsonPatchDocument ( ) : IList

Method Details

Add() public method

Add operation. Will result in, for example, { "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] }
public Add ( string path, object value ) : JsonPatchDocument
path string target location
value object value
return JsonPatchDocument

ApplyTo() public method

Apply this JsonPatchDocument
public ApplyTo ( object objectToApplyTo ) : void
objectToApplyTo object Object to apply the JsonPatchDocument to
return void

ApplyTo() public method

Apply this JsonPatchDocument
public ApplyTo ( object objectToApplyTo, Action logErrorAction ) : void
objectToApplyTo object Object to apply the JsonPatchDocument to
logErrorAction Action Action to log errors
return void

ApplyTo() public method

Apply this JsonPatchDocument
public ApplyTo ( object objectToApplyTo, IObjectAdapter adapter ) : void
objectToApplyTo object Object to apply the JsonPatchDocument to
adapter IObjectAdapter IObjectAdapter instance to use when applying
return void

Copy() public method

Copy the value at specified location to the target location. Willr esult in, for example: { "op": "copy", "from": "/a/b/c", "path": "/a/b/e" }
public Copy ( string from, string path ) : JsonPatchDocument
from string source location
path string target location
return JsonPatchDocument

JsonPatchDocument() public method

public JsonPatchDocument ( ) : System
return System

JsonPatchDocument() public method

public JsonPatchDocument ( List operations, IContractResolver contractResolver ) : System
operations List
contractResolver IContractResolver
return System

Move() public method

Removes value at specified location and add it to the target location. Will result in, for example: { "op": "move", "from": "/a/b/c", "path": "/a/b/d" }
public Move ( string from, string path ) : JsonPatchDocument
from string source location
path string target location
return JsonPatchDocument

Remove() public method

Remove value at target location. Will result in, for example, { "op": "remove", "path": "/a/b/c" }
public Remove ( string path ) : JsonPatchDocument
path string target location
return JsonPatchDocument

Replace() public method

Replace value. Will result in, for example, { "op": "replace", "path": "/a/b/c", "value": 42 }
public Replace ( string path, object value ) : JsonPatchDocument
path string target location
value object value
return JsonPatchDocument