I am trying to sort a list using delegates but I am getting a signature match error. The compiler says I cannot convert from an ‘anonymous method’
List<MyType> myList = GetMyList(); myList.Sort( delegate (MyType t1, MyType t2) { return (t1.ID < t2.ID); } );
What am I missing?
Here are some references I found and they do it the same way.
I think you want:
To sort you need something other than ‘true/false’, you need to know if its equal to, greater than, or less than.