本文整理汇总了C#中IPropertyValidator.GetErrorMessageFor方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyValidator.GetErrorMessageFor方法的具体用法?C# IPropertyValidator.GetErrorMessageFor怎么用?C# IPropertyValidator.GetErrorMessageFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyValidator
的用法示例。
在下文中一共展示了IPropertyValidator.GetErrorMessageFor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
return new Required
{
Message = propertyValidator.GetErrorMessageFor(propertyName)
};
}
示例2: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
return new GreaterThanOrEqual
{
Value = ((GreaterThanOrEqualValidator)propertyValidator).ValueToCompare,
Message = propertyValidator.GetErrorMessageFor(propertyName)
};
}
示例3: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
var emailRule = new Email
{
Message = propertyValidator.GetErrorMessageFor(propertyName)
};
return emailRule;
}
示例4: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
return new LessThan
{
Value = ((LessThanValidator)propertyValidator).ValueToCompare,
Message = propertyValidator.GetErrorMessageFor(propertyName)
};
}
示例5: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
return new Length
{
Min = ((ILengthValidator)propertyValidator).Min,
Max = ((ILengthValidator)propertyValidator).Max,
Message = propertyValidator.GetErrorMessageFor(propertyName)
};
}
示例6: GeneratorFrom
public Rule GeneratorFrom(string propertyName, IPropertyValidator propertyValidator)
{
var rule = new Regex
{
Message = propertyValidator.GetErrorMessageFor(propertyName),
Expression = ((IRegularExpressionValidator)propertyValidator).Expression
};
return rule;
}