public static void WithInvalidFormat(this IRuleArgsOptions ruleArgsOptions, string labelKey)
        {
            var message = ValidationMessageFormatter.InvalidFormatKey(labelKey);

            ruleArgsOptions.WithMessage(message);
        }
Пример #2
0
        public static IChainableConstraint <TConstraints> WithInvalidFormat <TConstraints>(this IChainableConstraint <TConstraints> chainableConstraint, string labelKey) where TConstraints : class
        {
            var message = ValidationMessageFormatter.InvalidFormatKey(labelKey);

            return(chainableConstraint.WithMessage(message));
        }
        public static void AddInvalidFormat <TEntity, TProperty>(this IConstraintValidatorContext constraintValidatorContext, string key, Expression <Func <TEntity, TProperty> > property)
        {
            var message = ValidationMessageFormatter.InvalidFormatKey(key);

            constraintValidatorContext.AddInvalid(message, property);
        }