C# Класс CardShop.Models.Validator.Comparator

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

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

Метод Описание
Comparator ( string otherProperty, Operator op = Operator.EqualTo ) : System

Will compare propery you signify in the annotation. By default, the operator is equal to. You are compoaring against the field. so greater than is field > otherProperty

Comparator ( string otherProperty, string errorMessage, Operator op = Operator.EqualTo ) : System

Will compare propery you signify in the annotation. By default, the operator is equal to. You are compoaring against the field. so greater than is field > otherProperty

GetClientValidationRules ( ModelMetadata metadata, ControllerContext context ) : IEnumerable

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

Метод Описание
IsValid ( object value, System.ComponentModel.DataAnnotations.ValidationContext ctx ) : System.ComponentModel.DataAnnotations.ValidationResult

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

Метод Описание
GetErrorMessage ( string propertyName ) : string

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

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

Will compare propery you signify in the annotation. By default, the operator is equal to. You are compoaring against the field. so greater than is field > otherProperty
public Comparator ( string otherProperty, Operator op = Operator.EqualTo ) : System
otherProperty string the property you want to compare against
op Operator the operator enum you want to call in
Результат System

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

Will compare propery you signify in the annotation. By default, the operator is equal to. You are compoaring against the field. so greater than is field > otherProperty
public Comparator ( string otherProperty, string errorMessage, Operator op = Operator.EqualTo ) : System
otherProperty string the property you want to compare against
errorMessage string Custom message you want to display.
op Operator the operator enum you want to call in
Результат System

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

public GetClientValidationRules ( ModelMetadata metadata, ControllerContext context ) : IEnumerable
metadata ModelMetadata
context ControllerContext
Результат IEnumerable

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

protected IsValid ( object value, System.ComponentModel.DataAnnotations.ValidationContext ctx ) : System.ComponentModel.DataAnnotations.ValidationResult
value object
ctx System.ComponentModel.DataAnnotations.ValidationContext
Результат System.ComponentModel.DataAnnotations.ValidationResult