title: C# How to combine multiple JSON arrays that are part of a List?
body: <p><strong>What has been done so far?</strong></p>
  <p>I am working on dividing up the number of records into 3 batches and processing them in parallel to increase the performance. However, after processing the batches in parallel I would also like to save the outcome (JSON string) of the processed records in a variable.</p>
  <p>As you can see below, I first initialize the variable as <code>List</code> of <code>string</code> and then run the <code>foreach</code> loop which saves the processed outcome as mentioned below.</p>
  <pre><code>List&lt;string&gt; responseOutcome = new List&lt;string&gt;();
  
  Parallel.ForEach(recordBatches, batch =&gt; { 
      responseOutcome.Add(response1.Content);
  });
  </code></pre>
  <p>Result in List <em>responseOutcome</em> comes as:</p>
  <p>responseOutcome[0]</p>
  <pre><code>[
    {
      &quot;Name&quot;: &quot;Sample1&quot;,
      &quot;ID&quot;: &quot;123&quot;
    },
    {
      &quot;Name&quot;: &quot;Sample2&quot;,
      &quot;ID&quot;: &quot;394&quot;
    }
  ],
  </code></pre>
  <p>responseOutcome[1]</p>
  <pre><code>[
    {
      &quot;Name&quot;: &quot;Sample5&quot;,
      &quot;ID&quot;: &quot;384&quot;
    },
    {
      &quot;Name&quot;: &quot;Sample6&quot;,
      &quot;ID&quot;: &quot;495&quot;
    }
  ],
  </code></pre>
  <p>responseOutcome[2]</p>
  <pre><code>[
    {
      &quot;Name&quot;: &quot;Sample3&quot;,
      &quot;ID&quot;: &quot;473&quot;
    },
    {
      &quot;Name&quot;: &quot;Sample4&quot;,
      &quot;ID&quot;: &quot;264&quot;
    }
  ]
  </code></pre>
  <p><strong>What I would like to achieve?</strong>
  Now I would like to take the value of <strong>responseOutcome</strong> which is multiple arrays of JSON string and merge them into one big <em>JSON string</em>.</p>
  <p><strong>Final Output</strong></p>
  <pre><code>    [
        {
          &quot;Name&quot;: &quot;Sample1&quot;,
          &quot;ID&quot;: &quot;123&quot;
        },
        {
          &quot;Name&quot;: &quot;Sample2&quot;,
          &quot;ID&quot;: &quot;394&quot;
        },
        {
          &quot;Name&quot;: &quot;Sample5&quot;,
          &quot;ID&quot;: &quot;384&quot;
        },
        {
          &quot;Name&quot;: &quot;Sample6&quot;,
          &quot;ID&quot;: &quot;495&quot;
        },
        {
          &quot;Name&quot;: &quot;Sample3&quot;,
          &quot;ID&quot;: &quot;473&quot;
        },
        {
          &quot;Name&quot;: &quot;Sample4&quot;,
          &quot;ID&quot;: &quot;264&quot;
        }
      ]
  </code></pre>
  <p>I looked into several similar cases but they weren't nearly similar. Like:</p>
  <p><a href="https://stackoverflow.com/questions/36147789/how-do-i-merge-multiple-json-objects">How do I merge multiple json objects</a></p>
  <p><a href="https://stackoverflow.com/questions/12516510/how-do-i-combine-two-arrays-from-two-jobjects-in-newtonsoft-json-net">How do I combine two arrays from two JObjects in Newtonsoft JSON.Net?</a></p>
  <p>Any help/guidance will be great!!</p>