title: How to Compare Jarray value with the Datatype using C#
body: <p>Here, Below is my JSON.</p>
  <pre><code>//MyJSON
  {
      &quot;Apply&quot;: &quot;Access&quot;,
      &quot;JSON&quot;: [{
          &quot;id&quot;: 1,
          &quot;File&quot;: &quot;File 1&quot;,
          &quot;Value&quot;: 0
      },
      {
          &quot;id&quot;: 2,
          &quot;File&quot;: &quot;File 2&quot;,
          &quot;Value&quot;: 0
      },
      {
          &quot;id&quot;: 3,
          &quot;File&quot;: &quot;File 3&quot;,
          &quot;Value&quot;: 1
      },
      {
          &quot;id&quot;: 4,
          &quot;File&quot;: &quot;File 4&quot;,
          &quot;Value&quot;: 1
      }]
  }
  //JSON 1
  {
      &quot;Apply&quot;: &quot;Access&quot;,
      &quot;JSON&quot;: [{
          &quot;id&quot;: 1,
          &quot;File&quot;: &quot;File 1&quot;,
          &quot;Value&quot;: 0
      },
      {
          &quot;id&quot;: 2,
          &quot;File&quot;: &quot;File 2&quot;,
          &quot;Value&quot;: 0
      }]
  }
  //JSON 2
  {
      &quot;Apply&quot;: &quot;Access&quot;,
      &quot;JSON&quot;: [{  
          &quot;id&quot;: 3,
          &quot;File&quot;: &quot;File 3&quot;,
          &quot;Value&quot;: 1
      },
      {
          &quot;id&quot;: 4,
          &quot;File&quot;: &quot;File 4&quot;,
          &quot;Value&quot;: 1
      }]
  }
  </code></pre>
  <p>For making the above response I'm trying to using the below code.</p>
  <pre><code>var Response = JObject.Parse(MyJSON);
  JArray JResponse = JArray.Parse(Response[&quot;JSON&quot;].ToString());
  foreach (var item in JResponse)
  {
      //Here I tried to compare the JArray With the String
      try
      {
          Console.WriteLine(item[&quot;Value&quot;]);
          //if (item[&quot;Value&quot;].Equals(0))
          if (item[&quot;Value&quot;].Equals(&quot;0&quot;))
          {
              Console.WriteLine(item[&quot;File&quot;]);
              Console.WriteLine(item[&quot;Value&quot;]);
              //var JSON1 = JsonConvert.SerializeObject(json1, Newtonsoft.Json.Formatting.Indented);
          }
          else
          { 
              Console.WriteLine(item[&quot;File&quot;]);
              Console.WriteLine(item[&quot;Value&quot;]);
              //var JSON2 = JsonConvert.SerializeObject(json2, Newtonsoft.Json.Formatting.Indented);
          }
          
      }
      catch(Exception e)
      {
          Console.WriteLine(&quot;Exception is : &quot; + e);
      }
          /*
          Console.WriteLine(item[&quot;id&quot;]);
          Console.WriteLine(item[&quot;File&quot;]);
          Console.WriteLine(item[&quot;Value&quot;]);
          */
  }
  </code></pre>
  <p>Here, I trying to compare sting value with JArray using the above code. But, Here It's not show anything as well not showing exception. It does not enter inside both if condition.
  Does anyone know how to compare JArray With the String/Integer value and make a separate(As it is) JSON like above?</p>