title: Extension Method that accepts delegate function
body: <p>I'm still trying to wrap my head around delegate functions and extension methods. I have created an extension method for <code>DropDownList</code>. I'd like to pass the function to be called in my extension method but I'm getting an error <code>Argument type 'IOrderedEnumerable&lt;KeyValuePair&lt;string,string&gt;&gt;' is not assignable to parameter type 'System.Func&lt;IOrderedEnumerable&lt;KeyValuePair&lt;string,string&gt;&gt;&gt;'</code></p>
  
  <pre><code>public static class DropDownListExtensions {
      public static void populateDropDownList(this DropDownList source, Func&lt;IOrderedEnumerable&lt;KeyValuePair&lt;string, string&gt;&gt;&gt; delegateAction) {
          source.DataValueField = "Key";
          source.DataTextField = "Value";
          source.DataSource = delegateAction;
          source.DataBind();
      }
  }
  </code></pre>
  
  <p>being called like so...</p>
  
  <pre><code>myDropDownList.populateDropDownList(getDropDownDataSource());
  </code></pre>
  
  <p>getDropDownDataSource signature...</p>
  
  <pre><code>protected IOrderedEnumerable&lt;KeyValuePair&lt;string,string&gt;&gt; getDropDownDataSource() {
      StateInfoXmlDocument stateInfoXmlDocument = new StateInfoXmlDocument();
      string schoolTypeXmlPath = string.Format(STATE_AND_SCHOOL_TYPE_XML_PATH, StateOfInterest, SchoolType);
      var nodes = new List&lt;XmlNode&gt;(stateInfoXmlDocument.SelectNodes(schoolTypeXmlPath).Cast&lt;XmlNode&gt;());
      return nodes.Distinct().Select(x =&gt; new KeyValuePair&lt;string, string&gt;(x.Attributes["area"].Value, x.Attributes["area"].Value)).OrderBy(x =&gt; x.Key);
  }
  </code></pre>