<p>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' </p>

<pre><code>List&lt;MyType&gt; myList = GetMyList();
myList.Sort( delegate (MyType t1, MyType t2) { return (t1.ID &lt; t2.ID); } );
</code></pre>

<p>What am I missing?</p>

<p>Here are some references I found and they do it the same way.</p>

<p><a href="http://www.developerfusion.com/code/5513/sorting-and-searching-using-c-lists/" rel="noreferrer">Developer Fusion Reference</a> </p>

<p><a href="http://blogs.msdn.com/devdev/archive/2006/06/30/652802.aspx" rel="noreferrer">Microsoft Reference</a></p>

The Sort doesn't take a binary predicate, it takes a
```
Comparison<T>
```
delegate which returns an
```
int
```
not a
```
bool
```
.
The return values are
```
0
```
for when the items are equal,
```
<0
```
for when the first item is less than the second, and
```
>0
```
for when the first item is greater than the second.