public static class ComparableExtensions { public static bool IsGreaterThan<T>(this T value, T other) where T : IComparable => value.CompareTo(other) > 0; public static bool IsLessThan<T>(this T value, T other) where T : IComparable => value.CompareTo(other) < 0; public static bool IsBetween<T>(this T value, T min, T max) where T : IComparable => value.CompareTo(min) >= 0 && value.CompareTo(max) <= 0; }
809200cookie-checkIComparable extensions