title: Group JSON data by two properties in C#
body: <p>I am trying to display and group json data and group the components and results of the entire array by one unique ID and then by date (for all the components and results in the array).</p>
  
  <p>I already took the data from the json file, now i am stuck with grouping the data.. </p>
  
  <p>Any help is appreciated, Thanks!</p>
  
  <p>Patients.cs:</p>
  
  <pre><code>namespace ConsoleApp
  {
      class Patient
      {
  
          public int ID{ get; set; }
          public string component { get; set; }
          public string result { get; set; }
          public string date { get; set; }
      }
  
      class Patients
      {
          public List&lt;Patient&gt; patients;
      }
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p><a href="https://i.stack.imgur.com/xYDtk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xYDtk.png" alt="TABLE"></a></p>