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)); }
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)); }