title: JSON Deserialize Object HTTPWebResponse
body: <p>I am trying to take my Web Request JSON output and parse it.  Here is the output</p>
  
  <pre><code>{
      "kind":"internal",
      "name":"SplashPageToggle_dg",
      "fullPath":"SplashPageToggle_dg",
      "generation":1255326,
      "selfLink":"https://link",
      "type":"stri ng",
      "records":[
          {
              "name":"enable_app1",
              "data":"0"
          },
          {
              "name":"enable_app2",
              "da ta":"0"
          },
          {
              "name":"enable_app3",
              "data":"0"
          },
          {
              "name":"enable_app4",
              "data":"0"
          },
          {
              "name":"enable_app5",
              "data":"0"
          },
          {
              "name":"enable_app6",
              "data":"1"
          },
          {
              "name":"enable_app7",
              "data":"0"
          },
          {
              "name":"enable_app8",
              "data":"0"
          },
          {
              "name":"enable_app9",
              "data":"0"
          },
          {
              "name":"enable_app10",
              "data":"0"
          }
      ]
  }
  </code></pre>
  
  <p>I have created public classes for these results</p>
  
  <pre><code>public class RootObject
  {
     public string kind { get; set; }
     public string name { get; set; }
     public string fullPath { get; set; }
     public int generation { get; set; }
     public string selfLink { get; set; }
     public string type { get; set; }
     public List&lt;Record&gt; records { get; set; }
  }
  
  public class Record
  {
     public string name { get; set; }
     public string data { get; set; }
  }
  </code></pre>
  
  <p>When I try to deserialize the Record class and choose the name, I get the name from the RootObject class.  Here is my code</p>
  
  <pre><code>static void Main(string[] args)
  {
     string url = "URL";    
     HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(url);
     getRequest.Method = "GET";
     getRequest.Credentials = new NetworkCredential("UN", "PW");   
     ServicePointManager.ServerCertificateValidationCallback = new
        RemoteCertificateValidationCallback
        (
           delegate { return true; }
        );
  
     var getResponse = (HttpWebResponse)getRequest.GetResponse();    
     Stream newStream = getResponse.GetResponseStream();
     StreamReader sr = new StreamReader(newStream);    
     var result = sr.ReadToEnd();    
     var splashInfo = JsonConvert.DeserializeObject&lt;Record&gt;(result);
  
     Console.WriteLine(splashInfo.name);
     Console.ReadLine();
  }
  </code></pre>