title: Converting VB.NET Lambda to C#
body: <p>Here is the working VB code where I am selecting the values of a Dictionary to write to a file.</p>
  
  <pre><code>Dim csv As String = String.Join(Environment.NewLine, 
      dmap.Select(Function(d) d.Key &amp; "," &amp; d.Value))
  
  Dim filePath As String = My.Computer.FileSystem.SpecialDirectories.Desktop &amp; "\myfile.csv"
  
  If File.Exists(filePath) Then
      File.Delete(filePath)
  End If
          '
  File.WriteAllText(filePath, csv)
  </code></pre>
  
  <p>I tried to convert the Lambda on line 1 to C# and got this far:</p>
  
  <pre><code>string csv = string.Join(Environment.NewLine, dmap.Select(d =&gt; d.Key + "," + d.Value));
  </code></pre>
  
  <p>The problem that is everything from <code>dmap.Select</code> to the end is underlined in Red. </p>
  
  <p>Here is what it says: </p>
  
  <blockquote>
    <p>System.Collections.Generic.Dictionary does not contain a definition for 'Select' accepting a first argument of type Dictionary could be found.</p>
  </blockquote>
  
  <p>What is the problem here ?   Many thanks !</p>