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.
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
Post a Comment