title: C# LINQ get count to dictionary
body: <p>I got a LINQ query with <a href="https://en.wikipedia.org/wiki/Entity_Framework" rel="nofollow noreferrer">Entity Framework</a> (EF) and getting a list of items. Now I want to create a dictionary with the  incrementing index of the item and the item itself.</p>
  <p>I have it like this:</p>
  <pre><code>result = context
      .Items
      .Where(b =&gt; !b.Deleted)
      .OrderBy(b =&gt; b.Name)
      .ToDictionary(COUNTHERE, b =&gt; b.Name)
  </code></pre>
  <p>So the dictionary have to look like this:</p>
  <pre><code>1: &quot;item1&quot;
  2: &quot;item2&quot;
  3: &quot;item5&quot;
  4: &quot;item10&quot;
  5: &quot;item100&quot;
  </code></pre>