Пример #1
0
        public static IRuleBuilderOptions <T, TProperty> WithLocalizedMessage <T, TProperty>(this IRuleBuilderOptions <T, TProperty> rule, Expression <Func <string> > resourceSelector, params object[] formatArgs)
        {
            var funcs = DefaultValidatorOptions.ConvertArrayOfObjectsToArrayOfDelegates <T>(formatArgs);

            return(rule.WithLocalizedMessage(resourceSelector, funcs));
        }
Пример #2
0
        public static IRuleBuilderOptions <T, TProperty> WithMessage <T, TProperty>(this IRuleBuilderOptions <T, TProperty> rule, string errorMessage, params object[] formatArgs)
        {
            var funcs = DefaultValidatorOptions.ConvertArrayOfObjectsToArrayOfDelegates <T>(formatArgs);

            return(rule.WithMessage(errorMessage, funcs));
        }