title: Dictionary as parameter, where the Value-Type is irrelevant
body: <p>I have a function, that returns the next higher value of a Dictionary-Keys-List compared to a given value. If we have a Key-List of {1, 4, 10, 24} and a given value of 8, the function would return 10.</p>
  
  <p>Obviously the type of the Value-Part of the Dictionary doesn't matter for the function, the function-code for a</p>
  
  <pre><code>Dictionary&lt;int, int&gt; 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Dictionary&lt;int, myClass&gt; 
  </code></pre>
  
  <p>would be the same.</p>
  
  <p>How has the method-head have to look like, when I want to call the function with any Dictionary, that has int as key-Type and the value-Type is irrelevant?</p>
  
  <p>I tried:</p>
  
  <pre><code>private int GetClosedKey(Dictionary&lt;int, object&gt; list, int theValue);
  </code></pre>
  
  <p>but it says that there are illegal arguments, when I call it with a Dictionary. I don't want to copy'n'paste the function for each different value-type that my function may be called. Any idea, how to accomplish that?</p>
  
  <p>Thanks in advance,
  Frank</p>