public static bool IsAtMostExclusive <T>(this T value, T max, IComparer <T>?comparer) => comparer.OrDefault().Compare(value, max) < 0;
public PropertyComparer(Func <T, P> getProperty, IComparer <P>?propertyComparer = null) { this.getProperty = getProperty ?? throw new ArgumentNullException(nameof(getProperty)); this.propertyComparer = propertyComparer.OrDefault(); }
public static bool IsAtLeastExclusive <T>(this T value, T min, IComparer <T>?comparer) => comparer.OrDefault().Compare(value, min) > 0;