I have a situation where I need to compare nullable types. Suppose you have 2 values:
int? foo=null; int? bar=4;
This will not work:
It can be simplified:
public static bool IsLessThan(this T? one, T? other) where T : struct { return Nullable.Compare(one, other) < 0; }