Class CompareValidator
- Namespace
- CloudyWing.FormValidators
- Assembly
- CloudyWing.FormValidators.dll
Compare the value of one column with the value of another column.
public class CompareValidator : FormValidatorBase, IFormValidator
- Inheritance
-
CompareValidator
- Implements
- Inherited Members
Constructors
CompareValidator(string, string, string, string, Func<string, string, string, string, string>)
Initializes a new instance of the CompareValidator class.
public CompareValidator(string column, string value, string comparisonColumn, string comparisonValue, Func<string, string, string, string, string> customErrorMessageAccessor = null)
Parameters
columnstringThe column.
valuestringThe value.
comparisonColumnstringThe comparison column.
comparisonValuestringThe comparison value.
customErrorMessageAccessorFunc<string, string, string, string, string>The custom error message accessor. The agrumts are column, value, comparison column, comparison value.
Properties
ComparisonColumn
Gets the comparison column.
public string ComparisonColumn { get; }
Property Value
- string
The comparison column.
ComparisonValue
Gets the comparison value.
public string ComparisonValue { get; }
Property Value
- string
The comparison value.
CustomErrorMessage
Gets the custom error message.
protected override string CustomErrorMessage { get; }
Property Value
- string
The custom error message.
CustomErrorMessageAccessor
Gets the custom range message format.
public Func<string, string, string, string, string> CustomErrorMessageAccessor { get; set; }
Property Value
DefaultErrorMessage
Gets the default error message.
protected override string DefaultErrorMessage { get; }
Property Value
- string
The default error message.
HasCustomErrorMessage
Gets a value indicating whether this instance has custom error message.
protected override bool HasCustomErrorMessage { get; }
Property Value
- bool
trueif this instance has custom error message; otherwise,false.
Methods
ValidateValue()
Validates the value.
protected override bool ValidateValue()
Returns
- bool
The validation result.