C# Класс RequiredIfAttribute, code

Наследование: ValidationAttribute, IClientValidatable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
FormatErrorMessage ( string name ) : string

Applies formatting to an error message, based on the data field where the error occurred.

RequiredIfAttribute ( string otherProperty, object otherPropertyValue )

Initializes a new instance of the RequiredIfAttribute class.

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

Метод Описание
IsValid ( object value, ValidationContext, validationContext ) : ValidationResult,

Validates the specified value with respect to the current validation attribute.

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

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

Applies formatting to an error message, based on the data field where the error occurred.
public FormatErrorMessage ( string name ) : string
name string The name to include in the formatted message.
Результат string

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

Validates the specified value with respect to the current validation attribute.
protected IsValid ( object value, ValidationContext, validationContext ) : ValidationResult,
value object The value to validate.
validationContext ValidationContext, The context information about the validation operation.
Результат ValidationResult,

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

Initializes a new instance of the RequiredIfAttribute class.
public RequiredIfAttribute ( string otherProperty, object otherPropertyValue )
otherProperty string The other property.
otherPropertyValue object The other property value.