sorting a list with linq myList.Sort(r => r.CompareTo(myobj));
Posted on 2011-09-30
I have a question regarding in linq in C# for sorting a list.
I have a function foo;
void foo(AAA myobj)
myList.Sort(r => r.CompareTo(myobj));
Please let me say I implement the CompareTo method of IComparable<MyClass>.
public int CompareTo(MyClass m) is the signiture of the implemented comparator.
but it gives an error, so could you tell me what is the problem?