JsonPatchExtensions Class

Summary

Extensions for [Microsoft.AspNet.JsonPatch.JsonPatchDocument`1]()

Syntax

public class JsonPatchExtensions

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.JsonPatchExtensions

Methods

ApplyTo<T>(Microsoft.AspNet.JsonPatch.JsonPatchDocument<T>, T, Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary)

Applies JSON patch operations on object and logs errors in [Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary]().

Arguments:
  • patchDoc (Microsoft.AspNet.JsonPatch.JsonPatchDocument{{T}}) – The [Microsoft.AspNet.JsonPatch.JsonPatchDocument`1]().
  • objectToApplyTo (T) – The entity on which [Microsoft.AspNet.JsonPatch.JsonPatchDocument`1]() is applied.
  • modelState (Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary]() to add errors.
public static void ApplyTo<T>(JsonPatchDocument<T> patchDoc, T objectToApplyTo, ModelStateDictionary modelState)where T : class
ApplyTo<T>(Microsoft.AspNet.JsonPatch.JsonPatchDocument<T>, T, Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary, System.String)

Applies JSON patch operations on object and logs errors in [Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary]().

Arguments:
  • patchDoc (Microsoft.AspNet.JsonPatch.JsonPatchDocument{{T}}) – The [Microsoft.AspNet.JsonPatch.JsonPatchDocument`1]().
  • objectToApplyTo (T) – The entity on which [Microsoft.AspNet.JsonPatch.JsonPatchDocument`1]() is applied.
  • modelState (Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary]() to add errors.
  • prefix (System.String) – The prefix to use when looking up values in [Microsoft.AspNet.Mvc.ModelBinding.ModelStateDictionary]().
public static void ApplyTo<T>(JsonPatchDocument<T> patchDoc, T objectToApplyTo, ModelStateDictionary modelState, string prefix)where T : class