public static bool Compare(object objValue1, object objValue2, ComparisonOperators enuOperator, Type objInnerType) { if (objInnerType == typeof(Double)) { return(Comparator.NumericComparison(SqlConvert.ToDouble(objValue1), SqlConvert.ToDouble(objValue2), enuOperator)); } else if (objInnerType == typeof(DateTime)) { return(Comparator.DateComparison(SqlConvert.ToDateTime(objValue1), SqlConvert.ToDateTime(objValue2), enuOperator)); } else if (objInnerType == typeof(TimeSpan)) { return(Comparator.TimeComparison((TimeSpan)objValue1, (TimeSpan)objValue2, enuOperator)); } else { throw new ArgumentException("Unsupported Type for Comparison"); } }