JsonPatchDocument<TModel> 類別

定義

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

類型參數

TModel
繼承
JsonPatchDocument<TModel>
屬性
Newtonsoft.Json.JsonConverterAttribute
實作

建構函式

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

屬性

ContractResolver
Operations

方法

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

將值新增至清單結尾

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

將值新增至指定位置的清單

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

新增作業。 將會導致 { 「op」: 「add」, 「path」: 「/a/b/c」, 「value」: [ 「foo」, 「bar」 ] }

ApplyTo(TModel)

套用此 JsonPatchDocument

ApplyTo(TModel, Action<JsonPatchError>)

套用此 JsonPatchDocument

ApplyTo(TModel, IObjectAdapter)

套用此 JsonPatchDocument

ApplyTo(TModel, IObjectAdapter, Action<JsonPatchError>)

套用此 JsonPatchDocument

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

從清單中的某個位置複製到另一個清單的結尾

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

從清單中的位置複製到清單中的新位置

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

從清單中的位置複製到新位置

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

複製到清單結尾

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

從屬性複製到清單中的位置

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

將位於指定位置的值複製到目標位置。 會產生,例如: { 「op」: 「copy」, 「from」: 「/a/b/c」, 「path」: 「/a/b/e」 }

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

從清單中的某個位置移至另一個清單的結尾

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

從清單中的位置移至清單中的另一個位置

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

從清單中的位置移至新位置

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

移至清單結尾

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

從屬性移至清單中的位置

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

移除位於指定位置的值,並將其新增至目標位置。 將會產生 ,例如: { 「op」: 「move」, 「from」: 「/a/b/c」, 「path」: 「/a/b/d」 }

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

從清單結尾移除值

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

從指定位置的清單中移除值

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

移除目標位置的值。 將會導致 { 「op」: 「remove」, 「path」: 「/a/b/c」 }

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

取代清單結尾的值

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

取代位於指定位置之清單中的值

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

取代值。 將會導致 { 「op」: 「replace」, 「path」: 「/a/b/c」, 「value」: 42 }

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

在清單結尾測試值

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

在指定位置的清單中測試值

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

測試值。 將會導致 { 「op」: 「test」, 「path」: 「/a/b/c」, 「value」: 42 }

明確介面實作

IJsonPatchDocument.GetOperations()

擴充方法

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

在 物件上套用 JSON 修補作業,並在 中 ModelStateDictionary 記錄錯誤。

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

在 物件上套用 JSON 修補作業,並在 中 ModelStateDictionary 記錄錯誤。

適用於