title: How to setup web api controller for ZipFile
body: <p>I am trying to create and return a zip file with selected documents. The console shows that the selected DocumentId's are being sent from the Angular controller to the api but I am getting a null error. </p>
  
  <p>ApiController</p>
  
  <pre><code> public HttpResponseMessage Get(string[] id)
      {
          List&lt;Document&gt; documents = new List&lt;Document&gt;();
          using (var context = new ApplicationDbContext())
          {
              Document document = context.Documents.Find(id);
  
              if (document == null)
              {
                  if (document == null)
                  {
                      throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound));
                  }
              }
  
              using (var zipFile = new ZipFile())
              {
                  // Make zip file
                  foreach (var d in documents)
                  {
                      var dt = d.DocumentDate.ToString("y").Replace('/', '-').Replace(':', '-');
                      string fileName = String.Format("{0}-{1}-{2}.pdf", dt, d.PipeName, d.LocationAb);
                      zipFile.AddEntry(fileName, d.DocumentUrl);
                  }
  
                  return ZipContentResult(zipFile);
              }
          }
      }
  
      protected HttpResponseMessage ZipContentResult(ZipFile zipFile)
      {
  
          var pushStreamContent = new PushStreamContent((stream, content, context) =&gt;
          {
              zipFile.Save(stream);
              stream.Close(); // After save we close the stream to signal that we are done writing.
          }, "application/zip");
  
          return new HttpResponseMessage(HttpStatusCode.OK) { Content = pushStreamContent };
      }
  </code></pre>
  
  <p>UPDATE</p>
  
  <pre><code>public HttpResponseMessage Get([FromUri] string[] id)
      {
          var documents = new List&lt;Document&gt;();
          using (var context = new ApplicationDbContext())
          {
              foreach (string doc in id)
              {
                  Document document = context.Documents.Find(new object[] { doc });
                  if (document == null)
                  {
                      throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound));
                  }
  
                  documents.Add(document);
              }
  
              using (var zipFile = new ZipFile())
              {
                  // Make zip file
                  foreach (var d in documents)
                  {
                      var dt = d.DocumentDate.ToString("y").Replace('/', '-').Replace(':', '-');
                      string fileName = String.Format("{0}-{1}-{2}.pdf", dt, d.PipeName, d.LocationAb);
                      zipFile.AddEntry(fileName, d.DocumentUrl);
                  }
  
                  return ZipContentResult(zipFile);
              }
          }
      }
  </code></pre>
  
  <p>ERROR</p>
  
  <blockquote>
    <p>{"The argument types 'Edm.Int32' and 'Edm.String' are incompatible for this operation. Near WHERE predicate, line 1, column 82."}</p>
  </blockquote>
  
  <p>STACKTRACE</p>
  
  <pre><code> at System.Data.Entity.Internal.Linq.InternalSet`1.FindInStore(WrappedEntityKey key, String keyValuesParamName)
     at System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues)
     at System.Data.Entity.DbSet`1.Find(Object[] keyValues)
     at  TransparentEnergy.ControllersAPI.apiZipPipeLineController.Get(String[] id)  in e:\Development\TransparentEnergy\TransparentEnergy\ControllersAPI  \BatchZipApi\apiZipPipeLineController.cs:line 25
     at lambda_method(Closure , Object , Object[] )
     at  System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor. &lt;&gt;c__DisplayClass10.&lt;GetExecutor&gt;b__9(Object instance, Object[]  methodParameters)
     at  System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Exec       ute(Object instance, Object[] arguments)
     at  System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpCo       ntrollerContext controllerContext, IDictionary`2 arguments,  CancellationToken cancellationToken)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/VkLcv.jpg" alt="Watch Screenshot"></p>
  
  <p>New Screenshot of watch after changing string[] id to List id
  <img src="https://i.stack.imgur.com/g9cc7.jpg" alt="new screenshot"></p>