I'm implementing IComparable
and IComprable<T>
in one of my classes. Is there any recommendation on how the CompareTo
method in each case should behave when given a null argument? Should it return a positive number or throw an ArgumentNullException
? Or can this behaviour vary depending on the implementing class?
I saw the MSDN documentation (here and here) but it has nothing to say on this subject. Any help will be appreciated.