C# Class FluentValidation.Validators.ScalePrecisionValidator

Allows a decimal to be validated for scale and precision. Scale would be the number of digits to the right of the decimal point. Precision would be the number of digits. It can be configured to use the effective scale and precision (i.e. ignore trailing zeros) if required. 123.4500 has an scale of 4 and a precision of 7, but an effective scale and precision of 2 and 5 respectively.
Inheritance: PropertyValidator
Afficher le fichier Open project: JeremySkinner/FluentValidation

Méthodes publiques

Méthode Description
ScalePrecisionValidator ( int scale, int precision ) : System
ScalePrecisionValidator ( int scale, int precision, string errorMessage ) : System
ScalePrecisionValidator ( int scale, int precision, string errorMessageResourceName, Type errorMessageResourceType ) : System

Méthodes protégées

Méthode Description
IsValid ( PropertyValidatorContext context ) : bool

Private Methods

Méthode Description
GetBits ( decimal Decimal ) : System.UInt32[]
GetMantissa ( decimal Decimal ) : decimal
GetPrecision ( decimal Decimal ) : int
GetScale ( decimal Decimal ) : int
GetUnsignedScale ( decimal Decimal ) : uint
Init ( int scale, int precision ) : void
NumTrailingZeros ( decimal Decimal ) : uint

Method Details

IsValid() protected méthode

protected IsValid ( PropertyValidatorContext context ) : bool
context PropertyValidatorContext
Résultat bool

ScalePrecisionValidator() public méthode

public ScalePrecisionValidator ( int scale, int precision ) : System
scale int
precision int
Résultat System

ScalePrecisionValidator() public méthode

public ScalePrecisionValidator ( int scale, int precision, string errorMessage ) : System
scale int
precision int
errorMessage string
Résultat System

ScalePrecisionValidator() public méthode

public ScalePrecisionValidator ( int scale, int precision, string errorMessageResourceName, Type errorMessageResourceType ) : System
scale int
precision int
errorMessageResourceName string
errorMessageResourceType System.Type
Résultat System