예제 #1
0
        public static M MustBeBetween <M, T, R>(this IMustPassRule <M, T, R> mpr, R greaterThan, Expression <Func <T, R> > lessThan)
            where R : IComparable <R>
        {
            BetweenRuleBoundsOption   bounds          = DefaultBoundOption;
            Expression <Func <T, R> > greaterThanFunc = f => greaterThan;
            Expression <Func <T, R> > lessThanFunc    = lessThan;

            return(MustBeBetween(mpr, greaterThanFunc, lessThanFunc, bounds));
        }
예제 #2
0
 public BetweenRule(Expression <Func <T, R> > value, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption options)
 {
     if (lessThan == null)
     {
         throw new ArgumentNullException("lessThan");
     }
     if (greaterThan == null)
     {
         throw new ArgumentNullException("greaterThan");
     }
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     _value       = value.Compile();
     _greaterThan = greaterThan.Compile();
     _lessThan    = lessThan.Compile();
     _options     = options;
     Initialize();
 }
예제 #3
0
 public BetweenRule(Expression <Func <T, R> > value, Expression <Func <T, R> > greaterThan, Expression <Func <T, R> > lessThan, BetweenRuleBoundsOption options)
 {
     this.value       = value.Compile();
     this.greaterThan = greaterThan.Compile();
     this.lessThan    = lessThan.Compile();
     this.options     = options;
     Initialize();
 }
예제 #4
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)));
 }