private void AssertComparable(ISqlValue a, ISqlValue b) { if (a == null || b == null) { return; } if (!a.IsComparableTo(b)) { throw new ArgumentException("Values are not comparable"); } }
/// <inheritdoc/> public virtual int Compare(ISqlValue x, ISqlValue y) { if (x == null && y == null) { return(0); } if (x == null) { return(1); } if (y == null) { return(-1); } if (!x.IsComparableTo(y)) { throw new NotSupportedException(); } return(((IComparable)x).CompareTo(y)); }