Wednesday, October 25, 2017

Implementing IComparable to Allow Sorting a Custom Type

Oct. 25, 2017

Introduction


One apple a day, keep doctor away. One program a day, also keep programmer awake. Today a small program keeps me awake to look into a few things, IComparer vs IComparable, throw new ArgumentExcecption on line 44. 

I like to share my practice using C# 2000 things, item 135: Implement IComparable to allow sorting a custom type.

Here is the C# code.


No comments:

Post a Comment