Tag: IComparer
How to make a Type Sortable on Different Criteria in C# ?
IComparable interface is a great way to sort your objects by using the sorting routines of the List. There is a another interface called IComparer<T> which allows the objects to be sorted based on different criteria. How to make a Type Sortable on Different Criteria in C# ? For example , if you wanted to sort the Employee objects by Id , you can create…