Imagine I have a generic method involving type T. In terms of usage, T will only ever be of type Nullable<long>
or Nullable<Guid>
.
Because T is Nullable, I can't impose the type constraint where T : IComparable<T>
on the method.
Given this, what is the most performant way of determining equality between two variables of type T within the method?
I am currently passing in a lambda function like (x, y) => x == y .. but feel there must be a better way.