title: .net core create on memory zipfile
body: <p>I am working on an MVC project where I create dynamically pdf files(wkhtmltopdf) which I want to return in a zip file. The pdf files are generated on fly - I don't need to store them, so my code to return a <strong>single</strong> file is:</p>
  
  <pre><code>File(pdfBytes, "application/pdf", "file_name")
  </code></pre>
  
  <p>Taking a look on <a href="https://docs.microsoft.com/en-us/dotnet/standard/io/how-to-compress-and-extract-files" rel="noreferrer">Microsoft docs</a> their example goes through stored files: </p>
  
  <pre><code> string startPath = @"c:\example\start";
   string zipPath = @"c:\example\result.zip";
   string extractPath = @"c:\example\extract";
  
   ZipFile.CreateFromDirectory(startPath, zipPath);
   ZipFile.ExtractToDirectory(zipPath, extractPath);
  </code></pre>
  
  <p>In my case I want to create N pdf files and return it to the view as a zip..
  Something like:</p>
  
  <pre><code>ZipFile zip = new ZipFile();
  foreach(var html in foundRawHTML)
  {
  //create pdf
  
  //append pdf to zip
  }
  
  return zip;
  </code></pre>
  
  <p>Although this is not doable because:</p>
  
  <ol>
  <li>ZipFile and File are statics and cannot be instatiated</li>
  <li>There is no way to add a file into a zip on fly(in memory)</li>
  </ol>
  
  <p>Any help is welcome</p>