title: How to search or filter List<Class> from JSON array?
body: <p>I have one class, class Patient and inside of that class, there is a List of Medicine. The data/values come from the JSON array it looks like this:</p>
  <p><strong>Classes:</strong></p>
  <pre><code>class Patient{
       private string patientName;
       private string patType;
       private int patTxId;
       private List&lt;medicine&gt; medicines;  
  }
  
  class medicines{
      private string medId;
      private string itemDesc;
      private int qty;
  }
  </code></pre>
  <p><strong>JSON:</strong></p>
  <pre><code>[
    {
       &quot;patientName&quot;: &quot;John Doe&quot;,
       &quot;patType&quot;: &quot;I&quot;,
       &quot;patTxId&quot;: &quot;100021&quot;,
       &quot;medicines&quot;: [
          {
             &quot;medId&quot;: &quot;M000021&quot;,
             &quot;itemDesc&quot;: &quot;Aspirin&quot;,
             &quot;qty&quot; : &quot;2&quot;
          },
          {
             &quot;medId&quot;: &quot;M000052&quot;,
             &quot;itemDesc&quot;: &quot;Paracetamol&quot;,
             &quot;qty&quot; : &quot;5&quot;
          }
       ]
    },
    {
       &quot;patientName&quot;: &quot;Jane Doe&quot;,
       &quot;patType&quot;: &quot;I&quot;,
       &quot;patTxId&quot;: &quot;100056&quot;,
       &quot;medicines&quot;: [
          {
             &quot;medId&quot;: &quot;M000021&quot;,
             &quot;itemDesc&quot;: &quot;Aspirin&quot;,
             &quot;qty&quot; : &quot;5&quot;
          }
       ]
    }
  ]
  </code></pre>
  <p>I want to filter the list from one patient having many medicines to one medicine having many patients based on the specific medicine. It looks like this:</p>
  <pre><code>Aspirin:
  2 John Doe
  5 Jane Doe
  
  Paracetamol:
  5 John Doe 
  </code></pre>
  <p>Is there any way to do this?</p>