title: How to use LINQ to get the first matching file from inside a ZipArchive?
body: <p>I would like to select a file as <code>ZipArchiveEntry</code> from within a <code>ZipArchive</code> using LINQ.</p>
  
  <p>What I have so far </p>
  
  <pre><code>string filename = "foo";
  using ( FileStream zipFile = new FileStream( Path.Combine( FilePathLocal, filename + ".zip" ), FileMode.Open ) ) {
      using ( ZipArchive archive = new ZipArchive( zipFile, ZipArchiveMode.Read ) ) {
          var txtInZip = archive.Entries.Select( x =&gt; x.FullName == filename + ".txt" );
          using ( Stream csvStream = txtInZip.Open() ) {
              ...
          }
      }
  }
  </code></pre>
  
  <p>This is the line I am having trouble with :</p>
  
  <pre><code>var txtInZip = archive.Entries.FirstOrDefault( x =&gt; x.FullName == filename + ".txt" );
  </code></pre>
  
  <p><code>txtInZip</code> is always returning null.  I also tried using <code>Select</code> in place of <code>FirstOrDefault</code></p>
  
  <p>What do I need to do to correct this LINQ query so that it returns the ZipArchiveEntry as intended ?</p>