c# - Problem sorting lists using delegates -


i trying sort list using delegates getting signature match error. compiler says cannot convert 'anonymous method'

list<mytype> mylist = getmylist(); mylist.sort( delegate (mytype t1, mytype t2) { return (t1.id < t2.id); } ); 

what missing?

here references found , same way.

developer fusion reference

microsoft reference

i think want:

mylist.sort( delegate (mytype t1, mytype t2)      { return (t1.id.compareto(t2.id)); }  ); 

to sort need other "true/false", need know if equal to, greater than, or less than.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -