using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var rs = a.Comparexxx<long>(b);
public static class AttributeExtensions
public static bool Comparexxx<T>(this T? myValue, T? otherValue)
var comparer = new NullableComparer<T>();
return comparer.Compare(myValue, otherValue) == 1 ? true : false;
public class NullableComparer<T> : IComparer<Nullable<T>>
public int Compare(Nullable<T> x, Nullable<T> y)
if (!x.HasValue && !y.HasValue)
if (x.HasValue && !y.HasValue)
if (y.HasValue && !x.HasValue)
return x.Value.Equals(y.Value) ? 1 : 0 ;