<p>So I have an object which has some fields, doesn't really matter what.
I have a generic list of these objects.</p>
<pre><code>List&lt;MyObject&gt; myObjects = new List&lt;MyObject&gt;();
myObjects.Add(myObject1);
myObjects.Add(myObject2);
myObjects.Add(myObject3);
</code></pre>
<p>So I want to remove objects from my list based on some criteria.
For instance, <code>myObject.X &gt;= 10.</code>
I would like to use the <code>RemoveAll(Predicate&lt;T&gt; match)</code> method for to do this.</p>
<p>I know I can define a delegate which can be passed into RemoveAll, but I would like to know how to define this inline with an anonymous delegate, instead of creating a bunch of delegate functions which are only used in once place.</p>

There's two options, an explicit delegate or a delegate disguised as a lamba construct:
explicit delegate
```
```
myObjects.RemoveAll(delegate (MyObject m) { return m.X >= 10; });
```
```
lambda
```
```
myObjects.RemoveAll(m => m.X >= 10);
```
```
Performance wise both are equal. As a matter of fact, both language constructs generate the same IL when compiled. This is because C# 3.0 is basically an extension on C# 2.0, so it compiles to C# 2.0 constructs