title: Converting IEnumerable<string> to Dictionary
body: <p>after adding <code>bool distinct</code> to method Splitter and checking if <code>distinct is true</code> the code broke. The quesry now instead of being dictionary is <code>IEnumerable&lt;string&gt;</code>, but whould be <code>Dictionary&lt;string, int&gt;</code>. How could it be solved? </p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.Dictionary'. An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>And the code:</p>
  
  <pre><code>private Dictionary&lt;string, int&gt; Splitter(string[] file, bool distinct)
  {
      var query = file
          .SelectMany(i =&gt; File.ReadLines(i)
          .SelectMany(line =&gt; line.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries))
          .AsParallel()
          .Select(word =&gt; word.ToLower())
          .Where(word =&gt; !StopWords.Contains(word))
          .Where(word =&gt; !StopWordsPl.Contains(word))
          .Where(word =&gt; !PopulatNetworkWords.Contains(word))
          .Where(word =&gt; !word.All(char.IsDigit)));
          if (distinct)
          {
          query = query.Distinct();
          }
  
         query.GroupBy(word =&gt; word)
              .ToDictionary(g =&gt; g.Key, g =&gt; g.Count());
         return query;
  }
  </code></pre>