title: how to write a method with delegate parameter in C# / .NET 4.0?
body: <p>I've been using the way that I declare delegate in class level:</p>
  
  <pre><code>protected delegate void FieldsDelegate();
  
  //and then write a method e.g.
  
  protected int CreateComponent(DbConnection cnctn, string tableName, Dictionary&lt;string, object&gt; changedFieldValues, FieldsDelegate fieldsDelegate)
  </code></pre>
  
  <p>However this is really cumbersome and I can't see instantly what the delegate is like. So I would like to do it like this:</p>
  
  <pre><code>protected int CreateComponent(DbConnection cnctn, string tableName, Dictionary&lt;string, object&gt; changedFieldValues, delegate void fieldsDelegate())
  </code></pre>
  
  <p>so that I don't have the separate definition.</p>
  
  <p>The above is not allowed for some reason. So how can I do it?</p>