C# Класс 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.
Наследование: PropertyValidator
Показать файл Открыть проект

Открытые методы

Метод Описание
ScalePrecisionValidator ( int scale, int precision ) : System
ScalePrecisionValidator ( int scale, int precision, string errorMessage ) : System
ScalePrecisionValidator ( int scale, int precision, string errorMessageResourceName, Type errorMessageResourceType ) : System

Защищенные методы

Метод Описание
IsValid ( PropertyValidatorContext context ) : bool

Приватные методы

Метод Описание
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

Описание методов

IsValid() защищенный Метод

protected IsValid ( PropertyValidatorContext context ) : bool
context PropertyValidatorContext
Результат bool

ScalePrecisionValidator() публичный Метод

public ScalePrecisionValidator ( int scale, int precision ) : System
scale int
precision int
Результат System

ScalePrecisionValidator() публичный Метод

public ScalePrecisionValidator ( int scale, int precision, string errorMessage ) : System
scale int
precision int
errorMessage string
Результат System

ScalePrecisionValidator() публичный Метод

public ScalePrecisionValidator ( int scale, int precision, string errorMessageResourceName, Type errorMessageResourceType ) : System
scale int
precision int
errorMessageResourceName string
errorMessageResourceType System.Type
Результат System