コード例 #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));
        }