C# 클래스 RequiredIfAttribute, code

상속: ValidationAttribute, IClientValidatable
파일 보기 프로젝트 열기: shendongnian/code 1 사용 예제들

공개 메소드들

메소드 설명
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.