Getting index of dictionary item based on item.key
<p>How can I find the index of an element of a dictionary based on the element key? I'm using the following code to go through the dictionary: </p>

<pre><code>foreach (var entry in freq)
{
    var word = entry.Key;
    var wordFreq = entry.Value;
    int termIndex = ??????;
}
</code></pre>

<p>Could anyone help please?</p>
