Table of Contents

Class LessThanValidator<T>

Namespace
CloudyWing.FormValidators.Core
Assembly
CloudyWing.FormValidators.dll

The less than other column value validator abstract class.

public abstract class LessThanValidator<T> : FormValidatorBase, IFormValidator where T : struct, IConvertible, IComparable<T>, IEquatable<T>

Type Parameters

T

The value type.

Inheritance
LessThanValidator<T>
Implements
Derived
Inherited Members

Constructors

LessThanValidator(string, string, string, string, bool, Func<string, string, string, string, bool, string>)

Initializes a new instance of the LessThanValidator<T> class.

protected LessThanValidator(string column, string value, string comparisonColumn, string comparisonValue, bool allowedEqual = true, Func<string, string, string, string, bool, string> customErrorMessageAccessor = null)

Parameters

column string

The column.

value string

The value.

comparisonColumn string

The comparison column.

comparisonValue string

The comparison value.

allowedEqual bool

if set to true [allowed equal].

customErrorMessageAccessor Func<string, string, string, string, bool, string>

The custom error message accessor. The arguments are column, value, comparison column, comparison value, allowed equal.

Properties

AllowedEqual

Gets or sets a value indicating whether [allowed equal].

public bool AllowedEqual { get; }

Property Value

bool

true if [allowed equal]; otherwise, false.

ComparisonColumn

Gets or sets the comparison column.

public string ComparisonColumn { get; }

Property Value

string

The comparison column.

ComparisonValue

Gets or sets 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, bool, string> CustomErrorMessageAccessor { get; set; }

Property Value

Func<string, string, string, string, bool, string>

The custom range message format.

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

true if this instance has custom error message; otherwise, false.

Methods

TryParse(string, out T)

Tries the parse.

protected abstract bool TryParse(string value, out T result)

Parameters

value string

The value.

result T

The result.

Returns

bool

Parse value to type T result.

ValidateValue()

Validates the value.

protected override bool ValidateValue()

Returns

bool

The validation result.