title: Search a Json object array- List vs Dictionary
body: <p>I deserialized a JsonResponse using the below code. </p>
  
  <pre><code>var data = (JObject)JsonConvert.DeserializeObject(jsonResponse);
  </code></pre>
  
  <p>I got the response string which looks something like this</p>
  
  <pre><code>{  
     "results":[  
        {  
           "url":"tickets/2063.json",
           "id":20794,
           "subject":"Device not working",
           "created_date": "2018-01-10T13:03:23Z",
           "custom-fields":[  
              {  
                 "id":25181002,
                 "value":34534
              },
              {  
                 "id":2518164,
                 "value":252344
              }
           ]
        }
     ]
  }
  </code></pre>
  
  <p>My objective is to read certain fields in this array of json objects and insert into a database. The fields i require are id, subject, created_date, member_id.</p>
  
  <p>The member id is part of the custom fields. member_id is the value where id=2518164. I've used List to store this, can you let me know if List or Dictionary is better for this case. How to implement a dictionary</p>
  
  <pre><code>var data = (JObject)JsonConvert.DeserializeObject(jsonResponse);
      var tickets = data["results"].ToList();
       foreach (var ticketItem in tickets){
          Int64? ticketFormId = ticketItem["id"].Value&lt;Int64&gt;();
          string subject = ticketItem["subject"].Value&lt;string&gt;();
          DateTime createdDate = ticketItem["created_date"].Value&lt;DateTime&gt;();
  
         //Do you think for the next step a dictionary is better or a List is better, since I want to search for a particular id=2518164
          var fieldsList = ticketItem["fields"].ToList();
          foreach(var fieldItem in fieldList){
              Int64? fieldId = fieldItem["id"].Value&lt;Int64&gt;();
              if(fieldId!=null &amp;&amp; fieldId == 2518164){
                  memberId = fieldItem["value"].Value&lt;string&gt;();
              }
          }
   }
  </code></pre>