Ejemplo n.º 1
0
        public static bool IsCompareToType(this IComparable value, IComparable otherValue, CompareToType compareToType)
        {
            switch (compareToType)
            {
            case CompareToType.Equals: return(value.IsEqualTo(otherValue));

            case CompareToType.GreaterThan: return(value.IsGreaterThan(otherValue));

            case CompareToType.GreaterThanOrEquals: return(value.IsGreaterThanOrEquals(otherValue));

            case CompareToType.LessThan: return(value.IsLessThan(otherValue));

            case CompareToType.LessThanOrEquals: return(value.IsLessThanOrEquals(otherValue));
            }
            return(false);
        }
Ejemplo n.º 2
0
 //[LinqToDB.Sql.Expression("{0} BETWEEN {1} AND {2}",PreferServerSide = true)]
 public static bool IsBetween(this IComparable x, IComparable min, IComparable max) => x.IsGreaterThanOrEquals(min) && x.IsLessThanOrEquals(max);