C# Events and Lambdas, alternative to null check?
<p>Does anybody see any drawbacks? It should be noted that you can't remove anonymous methods from an event delegate list, I'm aware of that (actually that was the conceptual motivation for this).</p>

<p>The goal here is an alternative to:</p>

<pre><code>if (onFoo != null) onFoo.Invoke(this, null);
</code></pre>

<p>And the code:</p>

<pre><code>public delegate void FooDelegate(object sender, EventArgs e);

public class EventTest
{
    public EventTest()
    {
        onFoo += (p,q) =&gt; { };
    }

    public FireFoo()
    {
         onFoo.Invoke(this, null);
    }

    public event FooDelegate onFoo;
</code></pre>

<p>}</p>
