So I have a collection of custom objects that have two main properties (bool IsSticky and DateTime DateModified) to sort on. I'd like to sort the collection to keep the Stickies up top first and then sort by DateModified descending.
Should I use LINQ to simply do this or write a custom comparer to sort first on the boolean and then on the datetime?
Question
+chorpeac MVC
So I have a collection of custom objects that have two main properties (bool IsSticky and DateTime DateModified) to sort on. I'd like to sort the collection to keep the Stickies up top first and then sort by DateModified descending.
Should I use LINQ to simply do this or write a custom comparer to sort first on the boolean and then on the datetime?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts