title: Extract JSON info and put into object
body: <p>So far I'm getting a valid response from my service with the populated JSON. My issue is how I'm supposed to parse through the JSON in order to put the <code>pAnn</code> into my object. I'm designing this for potential future use in the case that I need to assign more values from this JSON to objects. If there is an easier way to go about this, please let me know.  </p>
  
  <pre><code>public IEnumerable&lt;CP&gt; GetP()
  {
      string pURL, getPResult;
      var handler = new HttpClientHandler();
  
      handler.Credentials = new NetworkCredential("username", "password");
  
      using (HttpClient client = new HttpClient(handler))
      {
          pURL = String.Concat(validurl + 5854);
          client.BaseAddress = new Uri(pURL);                
          HttpResponseMessage result = client.GetAsync(client.BaseAddress).Result;       
  
          if (!result.IsSuccessStatusCode)
          {
              throw new WebException();
          }
          else
          {
              getPResult = result.Content.ReadAsStringAsync().Result;
          }                 
  
          var pDetails = JsonConvert.DeserializeObject&lt;List&lt;CP&gt;&gt;(getPResult);
  
          IEnumerable&lt;CP&gt; pResults = from cOpt in pDetails
                                                        select new CP
                                                        {
                                                            pAnn = cO.pAnn
                                                        };
          return pResults;
      }
  }
  </code></pre>
  
  <p>Here is my object:       </p>
  
  <pre><code>public class CP
  {
      public string pAnn { get; set; }
  }
  </code></pre>
  
  <p>Here is my JSON info I'm getting back:</p>
  
  <pre><code>{"data":{.... "cO":[{..... "pAnn":11111.11 .... },"errorMessages":[],"success":true}
  </code></pre>
  
  <p>I get an error at the <code>JsonConvert.DeserializeObject</code> line:</p>
  
  <blockquote>
    <p>Newtonsoft.Json.JsonSerializationException occurred Message=Cannot
    deserialize the current JSON object (e.g. {"name":"value"}) into type
    'System.Collections.Generic.List because the type requires a JSON
    array (e.g. [1,2,3]) to deserialize correctly. To fix this error
    either change the JSON to a JSON array (e.g. [1,2,3]) or change the
    deserialized type so that it is a normal .NET type (e.g. not a
    primitive type like integer, not a collection type like an array or
    List) that can be deserialized from a JSON object.
    JsonObjectAttribute can also be added to the type to force it to
    deserialize from a JSON object.</p>
  </blockquote>