Multiple Criteria for Sorting Objects
-
What is the recommended way to sort arrays of objects in multiple ways in C#? For example, given an array of employee data objects you might want to sort this array by > employee name > salary > employment date > employment date, then salary at different places in your application. Paul
-
What is the recommended way to sort arrays of objects in multiple ways in C#? For example, given an array of employee data objects you might want to sort this array by > employee name > salary > employment date > employment date, then salary at different places in your application. Paul
-
What is the recommended way to sort arrays of objects in multiple ways in C#? For example, given an array of employee data objects you might want to sort this array by > employee name > salary > employment date > employment date, then salary at different places in your application. Paul
Create several classes (or a single one, with all the features you need) which implement IComparer. When you call Array.Sort, pass an instance of this class as the second parameter. Yes, even I am blogging now!