title: Unable to pass array of integers to asp.net webapi from angular 7 application
body: <p>I am trying to pass an array of integer values to the server webapi endpoint via my angular 7 application getDocumentUploadDetailsByIds method. For some reason the endpoint is receiving null value. I have tried several ways but the parameter of the endpoint is null. Could somebody tell me where I am going wrong</p>
  
  <p>Component</p>
  
  <pre><code>  export interface IDocumentIds {
      ids: number[];
      }
  
            documentIds: IDocumentIds = &lt;IDocumentIds&gt;{};
  
  
            this.documentUploadService.createDocumentUpload(this.documents)
                      .then((result) =&gt; {
                          if (result) {
                              this.documentIds.ids = Object.keys(result).map(k =&gt; result[k]);
                              console.log(this.documentIds);
                              this.getDocumentUploadDetailsByIds(this.documentIds);
                              this.setGridOptions();
                              this.setColumns();
                              this.notify.success('Documents uploaded Successfully');
                          }
                      }).catch(err =&gt; {
                          this.notify.error('An Error Has Occured While uploading the documents');
                      });
  
   public getDocumentUploadDetailsByIds(documentIds) {
          if (this.ManagerStrategyId != null) {
              this.Loading = true;
  
              this.initGrid();
              this.documentUploadService.getDocumentUploadDetailsByIds(documentIds)
              .then((data) =&gt; {
                  if (data) {
                      this.DocumentUploadDetails = data;
                      this.Loading = false;
                      this.notify.success('Documents uploaded Successfully');
                  }
              }).catch(err =&gt; {
                  this.notify.error('An Error Has Occured While uploading the documents');
              });
          }
      }
  </code></pre>
  
  <p>Service</p>
  
  <pre><code>     getDocumentUploadDetailsByIds(documentIds: IDocumentIds) {
                      return this.mgr360CommonService.httpGetByKey('/api/documentupload/detailsByIds' ,  documentIds);
                    }      
  
  const httpPostOptions = {
  
      headers:
          new HttpHeaders(
              {
                  'Content-Type': 'application/json; charset=utf-8',
              }),
  
      withCredentials: true,
  };
  
          httpGetByKey(url: string, key: any) {
  
              return this.httpClient.get(this.webApiLocation + url + '/' + key, httpPostOptions)
                  .pipe(map((response: Response) =&gt; {
                      return response;
                  }))
                  .toPromise()
                  .catch((error: any) =&gt; {
                      this.onError(error);
                      return Promise.reject(error);
                  });
          }
  </code></pre>
  
  <p>asp.net web api
      model</p>
  
  <pre><code>  public class DocumentIdViewModel
      {
         public int[] ids;
      }
  </code></pre>
  
  <p>Endpoint </p>
  
  <pre><code> [HttpGet]
              [Route("api/documentupload/detailsByIds/{id}")]
              public IHttpActionResult DetailsByIds(DocumentIdViewModel documentIds)
              {
                  var viewModel = GetDocumentUploadDetailsByIds(documentIds);
                  return Ok(viewModel);
              }
  </code></pre>
  
  <p>I have also tried setting the parameter to int array of the web method</p>
  
  <p>From angular </p>
  
  <pre><code>this.getDocumentUploadDetailsByIds(this.documentIds.ids);
  </code></pre>
  
  <p>On server</p>
  
  <pre><code> public IHttpActionResult DetailsByIds(int[] documentIds)
          {
              var viewModel = GetDocumentUploadDetailsByIds(documentIds);
              return Ok(viewModel);
          }
  </code></pre>