示例#1
0
 public static M MustBeOfType <M, T, R>(this IMustPassRule <M, T, R> mpr, Type type)
 {
     return(mpr.MustPassRule(new OfTypeRule <R>(type)));
 }
示例#2
0
 public static M MustPassGenericRule <M, T, R>(this IMustPassRule <M, T, R> mpr, Func <R, bool> rule)
 {
     return(mpr.MustPassRule(new GenericRule <R>(rule)));
 }
示例#3
0
 public static M MustNotEqual <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > value, IEqualityComparer <R> comparer)
 {
     return(mpr.MustPassRule(new NotEqualRule <T, R>(mpr.Expression, value, comparer)));
 }
示例#4
0
 public static M MustMatchRegex <M, T>(this IMustPassRule <M, T, string> mpr, string pattern, RegexOptions options)
 {
     return(mpr.MustPassRule(new RegexRule(new Regex(pattern, options))));
 }
示例#5
0
 public static M MustBeNull <M, T, R>(this IMustPassRule <M, T, R> mpr)
     where R : class
 {
     return(mpr.MustPassRule(new NullRule <R>()));
 }
 public static M MustBeGreaterThan <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > greaterThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new GreaterThanRule <T, R>(GetExpression(mpr), greaterThan, false)));
 }
示例#7
0
 public static M MustNotBeOneOf <M, T, R>(this IMustPassRule <M, T, R> mpr, IEqualityComparer <R> comparer, params R[] values)
 {
     return(mpr.MustPassRule(new NotOneOfRule <R>(values, comparer)));
 }
示例#8
0
 public static M MustBeGreaterThanOrEqualTo <M, T, R>(this IMustPassRule <M, T, R> mpr, R greaterThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new GreaterThanRule <R>(greaterThan, true)));
 }
示例#9
0
 public static M MustNotBeOneOf <M, T, R>(this IMustPassRule <M, T, R> mpr, IEnumerable <R> values)
 {
     return(mpr.MustPassRule(new NotOneOfRule <R>(values)));
 }
示例#10
0
 public static M MustNotBeOneOf <M, T, R>(this IMustPassRule <M, T, R> mpr, params R[] values)
 {
     return(mpr.MustPassRule(new NotOneOfRule <R>(values)));
 }
示例#11
0
 public static M MustBeOneOf <M, T, R>(this IMustPassRule <M, T, R> mpr, IEnumerable <R> values, IEqualityComparer <R> comparer)
 {
     return(mpr.MustPassRule(new OneOfRule <R>(values, comparer)));
 }
示例#12
0
 public static M MustBeBetween <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption bounds)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new BetweenRule <T, R>(mpr.Expression, greaterThan, lessThan, bounds)));
 }
 public static M MustBeNull <M, T, R>(this IMustPassRule <M, T, Nullable <R> > mpr)
     where R : struct
 {
     return(mpr.MustPassRule(new NullableNullRule <R>()));
 }
示例#14
0
 public static M MustBeLessThan <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > lessThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new LessThanRule <T, R>(mpr.Expression, lessThan, false)));
 }
示例#15
0
 public static M MustNotEqual <M, T, R>(this IMustPassRule <M, T, R> mpr, R value)
 {
     return(mpr.MustPassRule(new NotEqualRule <R>(value)));
 }
示例#16
0
 public static M MustBeLessThanOrEqualTo <M, T, R>(this IMustPassRule <M, T, R> mpr, R lessThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new LessThanRule <R>(lessThan, true)));
 }
示例#17
0
 public static M MustNotEqual <M, T, R>(this IMustPassRule <M, T, R> mpr, R value, IEqualityComparer <R> comparer)
 {
     return(mpr.MustPassRule(new NotEqualRule <R>(value, comparer)));
 }
示例#18
0
 public static M MustBeGreaterThanOrEqualTo <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > greaterThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new GreaterThanRule <T, R>(mpr.Expression, greaterThan, true)));
 }
示例#19
0
 public static M MustNotEqual <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > value)
 {
     return(mpr.MustPassRule(new NotEqualRule <T, R>(mpr.Expression, value)));
 }
示例#20
0
 public static M MustNotBeNullOrEmpty <M, T>(this IMustPassRule <M, T, string> mpr)
 {
     return(mpr.MustPassRule(new NotNullOrEmpty()));
 }
 public static M MustBeLessThanOrEqualTo <M, T, R>(this IMustPassRule <M, T, R> mpr, Expression <Func <T, R> > lessThan)
     where R : IComparable <R>
 {
     return(mpr.MustPassRule(new LessThanRule <T, R>(GetExpression(mpr), lessThan, true)));
 }