Example #1
0
 /// <summary>
 /// Range.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="ruleBuilderInitial"></param>
 /// <returns></returns>
 public static IRuleBuilderInitial <T, int> Min <T>(this IRuleBuilderInitial <T, int> ruleBuilderInitial, int min)
 {
     ruleBuilderInitial
     .GreaterThanOrEqualTo(min)
     .WithMessage("{PropertyName}必须大于等于{Min}");
     return(ruleBuilderInitial);
 }
Example #2
0
 /// <summary>
 /// Range.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="ruleBuilderInitial"></param>
 /// <returns></returns>
 public static IRuleBuilderInitial <T, int> Range <T>(this IRuleBuilderInitial <T, int> ruleBuilderInitial, int max, int min)
 {
     ruleBuilderInitial
     .GreaterThanOrEqualTo(min)
     .LessThanOrEqualTo(max)
     .WithMessage("{PropertyName}必须介于{Min}与{Max}之间");
     return(ruleBuilderInitial);
 }