Click or drag to resize
IJenevaValidationContext Methods

The IJenevaValidationContext type exposes the following members.

Methods
  NameDescription
Public methodAddNested
Propogates current field to path. For ex. if current field is 'User', call AddNested(), then call SetField("Name", null) - the failure path would be - User.Name. Usually after AddNested() call, SetTarget() must be called as well.
Public methodAssert
Throws ValidationException if at least one failure was registered
Public methodFail(String)
Register failure using current path
Public methodFail(Failure)
Register failure
Public methodFailRoot
Register failure without path
Public methodIsAssigned
True if current field is assigned, otherwise false
Public methodIsNull
True is current field is null, otherwise false
Public methodIsValidFormat
True if current field is correctly parsed, otherwise false
Public methodMustBeAssigned
Validates if current field is assigned (was present in incoming JSON)
Public methodMustBeGreaterOrEqualTo
Validates if current field value (IComparable) is greater or equal to m
Public methodMustBeGreaterThan
Validates if current field value (IComparable) is greater than m
Public methodMustBeLessOrEqualTo
Validates if current field value (IComparable) is less or equal to m
Public methodMustBeLessThan
Validates if current field value (IComparable) is less than m
Public methodMustBeNotAssigned
Validates if current field value is not assigned by JSON deserializer
Public methodMustBeNotEmptyString
Validates if current field value is not string.Empty
Public methodMustBeNotNull
Validates if current field value is not null
Public methodMustBeNull
Validates if current field value is null
Public methodMustBeValidFormat
Validates if current field value is correctly parsed
Public methodMustEqualTo
Validates if current field value is equal to the value
Public methodMustEqualToOneOf
Validates if current field value is equal to one of the values
Public methodMustHaveCountBetween
Validates if current field value count (ICollection.Count) is between min and max count
Public methodMustHaveLengthBetween
Validates if current field value length (string.Length) is between min and max
Public methodMustHaveMaxAssignedFieldsCount
Validates if number of assigned fields in the current target is less or equal to max number
Public methodMustHaveMinAssignedFieldsCount
Validates if number of assigned fields in the current target is greater or equal to min number
Public methodMustNotEqualTo
Validates if current field value is not equal to the value
Public methodMustNotEqualToAnyOf
Validates if current field value is not equal to any of the values
Public methodMustRegexpr
Validates if current field value follows the regular expression
Public methodRemoveNested
Goes onу node back in path
Public methodSetField
Sets current field (property) name
Public methodSetIndex
Sets current index (used for indexed properties). For ex. current target is 'Children' and index is '7' and field 'Name' - failure would have path this path - 'children[7].name'.
Public methodSetTarget
Sets current target object
Top
See Also