Let's say we have an entity that has attributes att1 and att2, where att1 can have values a, b, c and att2, can have values 1,2,3. Is it possible to use LINQ so that we can sort the elements in the collection using an arbitrary sort rule without implementing IComparable. I ran into a problem because the business requires that on some screens the elements in the collection are sorted one way and on other screens in some other way. For example, a rule may indicate that items should be sorted so that “b” is first indicated, then “a”, then “c” and within each group “first 3”, then “1”, then “2”.
source
share