title: Cannot deserialize the current JSON object to GenericList
body: <p>I have recently finished writing up a proof of concept on a rather extensive REST API to support our legacy data components. However I've found that it's been running quite slowly when processing larger data sets (40k+ items). </p>
  
  <p>After some researching I found a thread on SO claiming that it could be more efficient by using <code>memorystream</code>, <code>HttpClientHandlers</code> and more importantly compression in terms of <code>Gzip</code>. So I updated my current .NET version and started to rewrite the API in VS2017. </p>
  
  <p><strong><em>(It should be mentioned that I've never worked with these datastructures)</em></strong></p>
  
  <p>I then followed along in the example, but have hit a wall. I'm getting this error message when attempting to get some data out of the API (<strong>this is just a snippet of the error</strong>):</p>
  
  <blockquote>
    <p>"Message":"An error has occurred.","ExceptionMessage":"Cannot
    deserialize the current JSON object (e.g. {\"name\":\"value\"}) into
    type
    'System.Collections.Generic.List`1[RESTWebApi.Models.TRK_TrackerFeatures]'</p>
  </blockquote>
  
  <p>And this is the code:</p>
  
  <pre><code>public async Task&lt;IHttpActionResult&gt; GetAll()
  {
      DataSet ds = dc.FETCHTRK_TrackerFeatures("", conStr, "");
      List&lt;TRK_TrackerFeatures&gt; arr = new List&lt;TRK_TrackerFeatures&gt;();
      foreach (DataTable table in ds.Tables)
      {
          foreach (DataRow row in table.Rows)
          {
              int? id = row["ID"] as int?;
              String trackercode = row["TrackerCode"] as String;
              Boolean? applicabletoproject = row["ApplicableToProject"] as Boolean?;
              int? trk_feature_lkid = row["TRK_Feature_LKID"] as int?;
              int? trk_trackerstatus_lkid = row["TRK_TrackerStatus_LKID"] as int?;
              int? trk_trackerstatus_lkid2 = row["TRK_TrackerStatus_LKID2"] as int?;
              Boolean? readyforwork = row["ReadyForWork"] as Boolean?;
              String action = row["Action"] as String;
              String responsibleperson = row["ResponsiblePerson"] as String;
              int? tminus = row["TMinus"] as int?;
              DateTime? datetobeactioned = row["DateToBeActioned"] as DateTime?;
              int? trk_startdateid = row["TRK_StartDateID"] as int?;
              String accountableperson = row["AccountablePerson"] as String;
              String comments = row["Comments"] as String;
              DateTime? datestamp = row["DateStamp"] as DateTime?;
              arr.Add(new TRK_TrackerFeatures
              {
                  ID = id,
                  TrackerCode = trackercode,
                  ApplicableToProject = applicabletoproject,
                  TRK_Feature_LKID = trk_feature_lkid,
                  TRK_TrackerStatus_LKID = trk_trackerstatus_lkid,
                  TRK_TrackerStatus_LKID2 = trk_trackerstatus_lkid2,
                  ReadyForWork = readyforwork,
                  Action = action,
                  ResponsiblePerson = responsibleperson,
                  TMinus = tminus,
                  DateToBeActioned = datetobeactioned,
                  TRK_StartDateID = trk_startdateid,
                  AccountablePerson = accountableperson,
                  Comments = comments,
                  DateStamp = datestamp
              });
          }
      }
      using (HttpClientHandler handler = new HttpClientHandler())
      {
          handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
          using (HttpClient client = new HttpClient(handler, false))
          {
              string json = JsonConvert.SerializeObject(arr);
              byte[] jsonBytes = Encoding.UTF8.GetBytes(json);
              MemoryStream ms = new MemoryStream();
              using (GZipStream gzip = new GZipStream(ms, CompressionMode.Compress, true))
              {
                  gzip.Write(jsonBytes, 0, jsonBytes.Length);
              }
              ms.Position = 0;
              StreamContent content = new StreamContent(ms);
              content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
              content.Headers.ContentEncoding.Add("gzip");
              HttpResponseMessage response = await client.PostAsync("http://localhost:61090/api/TRK_TrackerFeatures/GetAll", content);
              List&lt;TRK_TrackerFeatures&gt; results = await response.Content.ReadAsAsync&lt;List&lt;TRK_TrackerFeatures&gt;&gt;(); &lt;== error here
              Debug.WriteLine(String.Join(", ", results)); // 
          }
      }
      return Ok();
  }
  </code></pre>