title: How to use Linq to check tags within JSon
body: <p>I have below JSon File :-</p>
  
  <pre><code>{
    "requirements": {
      "-FileName": "sample.xls",
      "requirement": [
        {
          "desc": "Employee status        will be classified as: 
  •   Assigned $ when employee is working on a project. 
  •   Reserved when employee is scheduled to work on a project in near future. Unassigned when employee is not working on project.",
          "Id": "Req40"
        },
        {
          "Id": "NFR-2",
          "desc": "Team Leader should create resource allocation $% request in Maintain Project Module. Resource allocation request $@is associated with only one role. Project $@ Manager should provide roll-on date and roll-off date in resource allocation request."
        },
        {
          "Id": "req2",
          "desc": "PRMS must always be available except during the &amp; @ scheduled maintenance. Scheduled maintenance must always be at 8PM on week days.",
          "message": "message of Req3"
        }
      ]
    }
  }
  </code></pre>
  
  <p>I want to check if Tags other than "Id" and "desc" are present in JSon.</p>
  
  <p>For this I have used for loop as below :-</p>
  
  <pre><code>for (int i = 0; i &lt; NumberOfRequirements; i++)
  {
      int NumberOfTagsInJson = (obj["requirements"]["requirement"][i]).Count();
      if (NumberOfTagsInJson == 2) // checks if tag other than id and desc is present Eg. Message
      {
          var id = obj["requirements"]["requirement"][i]["Id"];
          if (id == null)
          {
              IsHavingValidTags = false;
              break;
          }
  
          var Desc = obj["requirements"]["requirement"][i]["desc"];
          if (Desc == null)
          {
              IsHavingValidTags = false;
              break;
          }
      }
      else
      {
          IsHavingValidTags = false;
          break;
      }
  }
  </code></pre>
  
  <p>How can I optimize it without using for loop.
  Eg. I tried converting it into List as:-</p>
  
  <pre><code>(obj["requirements"]["requirement"]).ToList()
  </code></pre>
  
  <p>After this I wanted to use Linq to check if tags other than "Id" and "Desc" are present.</p>
  
  <p>How can I use it?</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p><a href="https://i.stack.imgur.com/opMyC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/opMyC.jpg" alt="enter image description here"></a></p>