JsonPatchDocument<TModel> Class

Definition

generic <typename TModel>
 where TModel : classpublic ref class JsonPatchDocument : Microsoft::AspNetCore::JsonPatch::IJsonPatchDocument
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.AspNetCore.JsonPatch.Converters.TypedJsonPatchDocumentConverter))]
public class JsonPatchDocument<TModel> : Microsoft.AspNetCore.JsonPatch.IJsonPatchDocument where TModel : class
[<Newtonsoft.Json.JsonConverter(typeof(Microsoft.AspNetCore.JsonPatch.Converters.TypedJsonPatchDocumentConverter))>]
type JsonPatchDocument<'Model (requires 'Model : null)> = class
    interface IJsonPatchDocument
Public Class JsonPatchDocument(Of TModel)
Implements IJsonPatchDocument

Type Parameters

TModel
Inheritance
JsonPatchDocument<TModel>
Attributes
Newtonsoft.Json.JsonConverterAttribute
Implements

Constructors

JsonPatchDocument<TModel>()
JsonPatchDocument<TModel>(List<Operation<TModel>>, IContractResolver)

Properties

ContractResolver
Operations

Methods

Add<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp, Int32)

Add value to list at given position

Add<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp)

Add value to the end of the list

Add<TProp>(Expression<Func<TModel,TProp>>, TProp)

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

ApplyTo(TModel, Action<JsonPatchError>)

Apply this JsonPatchDocument

ApplyTo(TModel, IObjectAdapter, Action<JsonPatchError>)

Apply this JsonPatchDocument

ApplyTo(TModel, IObjectAdapter)

Apply this JsonPatchDocument

ApplyTo(TModel)

Apply this JsonPatchDocument

Copy<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,IList<TProp>>>, Int32)

Copy from a position in a list to a new location in a list

Copy<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,IList<TProp>>>)

Copy from a position in a list to the end of another list

Copy<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,TProp>>)

Copy from a position in a list to a new location

Copy<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,IList<TProp>>>, Int32)

Copy from a property to a location in a list

Copy<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,IList<TProp>>>)

Copy to the end of a list

Copy<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,TProp>>)

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

Move<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,IList<TProp>>>, Int32)

Move from a position in a list to another location in a list

Move<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,IList<TProp>>>)

Move from a position in a list to the end of another list

Move<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32, Expression<Func<TModel,TProp>>)

Move from a position in a list to a new location

Move<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,IList<TProp>>>, Int32)

Move from a property to a location in a list

Move<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,IList<TProp>>>)

Move to the end of a list

Move<TProp>(Expression<Func<TModel,TProp>>, Expression<Func<TModel,TProp>>)

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<TProp>(Expression<Func<TModel,IList<TProp>>>, Int32)

Remove value from list at given position

Remove<TProp>(Expression<Func<TModel,IList<TProp>>>)

Remove value from end of list

Remove<TProp>(Expression<Func<TModel,TProp>>)

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

Replace<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp, Int32)

Replace value in a list at given position

Replace<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp)

Replace value at end of a list

Replace<TProp>(Expression<Func<TModel,TProp>>, TProp)

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

Test<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp, Int32)

Test value in a list at given position

Test<TProp>(Expression<Func<TModel,IList<TProp>>>, TProp)

Test value at end of a list

Test<TProp>(Expression<Func<TModel,TProp>>, TProp)

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

Explicit Interface Implementations

IJsonPatchDocument.GetOperations()

Extension Methods

ApplyTo<T>(JsonPatchDocument<T>, T, ModelStateDictionary, String)

Applies JSON patch operations on object and logs errors in ModelStateDictionary.

ApplyTo<T>(JsonPatchDocument<T>, T, ModelStateDictionary)

Applies JSON patch operations on object and logs errors in ModelStateDictionary.

Applies to