Class ValidatorExtensions
- Namespace
- Cuemon.Extensions.Newtonsoft.Json
- Assembly
- Cuemon.Extensions.Newtonsoft.Json.dll
Extension methods for the Validator class.
public static class ValidatorExtensions
- Inheritance
-
ObjectValidatorExtensions
Methods
InvalidJsonDocument(Validator, ref JsonReader, String, String)
Validates and throws an System.ArgumentException if the specified argument
is not a valid JSON representation as specified in RFC 8259.
public static void InvalidJsonDocument(this Validator _, ref JsonReader argument, string paramName = null, string message = "Value must be a JSON representation that complies with RFC 8259.")
Parameters
_
ValidatorThe Validator to extend.
argument
JsonReaderThe Newtonsoft.Json.JsonReader to be evaluated.
paramName
StringThe name of the parameter that caused the exception.
message
StringA message that describes the error.
Exceptions
- System.ArgumentException
argument
must be a JSON representation that complies with RFC 8259.
InvalidJsonDocument(Validator, String, String, String)
Validates and throws an System.ArgumentException if the specified argument
is not a valid JSON representation as specified in RFC 8259.
public static void InvalidJsonDocument(this Validator _, string argument, string paramName = null, string message = "Value must be a JSON representation that complies with RFC 8259.")
Parameters
_
ValidatorThe Validator to extend.
argument
StringThe JSON string to be evaluated.
paramName
StringThe name of the parameter that caused the exception.
message
StringA message that describes the error.
Exceptions
- System.ArgumentException
argument
must be a JSON representation that complies with RFC 8259.