title: Deserializing JSON using System.Runtime.Serialization.Json
body: <p>I'm having issues with deserializing some json with C#.</p>
  
  <p>Suppose this is a snippet of the json I'm being sent (repeated many times, but nothing else other than id/name):</p>
  
  <pre><code>[
      {
      "id":0,
      "name":"N/A"
      },
      {
          "id":1,            
          "name":"Annie"            
      },
      {
          "id":2,            
          "name":"Olaf"            
      }    
  ]
  </code></pre>
  
  <p>If the top level was named, I'd do something like </p>
  
  <pre><code>[DataContract]
  public class ChampList
  {
      [DataMember(Name = "SOMENAME")]
      public ElophantChamp[] ElophantChamps { get; set; }
  }
  
  [DataContract]
  public class ElophantChamp
  {
      [DataMember(Name = "id")]
      public int ID { get; set; }
  
      [DataMember(Name = "name")]
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>and then deserialize it by calling this:</p>
  
  <pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  
  DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(ChampList));
  object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
  ChampList jsonResults = objResponse as ChampList;
  </code></pre>
  
  <p>But in the case where there is no top level container object and I can't have blank datamember name, what do I do?  I just get a null value if I leave the DataMember unnamed (i.e. leave it as just [DataMember]), which I would take to indicate that couldn't parse it correctly.  </p>
  
  <p>No errors are thrown and the sesponse stream is populated with exactly what I expect.</p>
  
  <p>From what I can tell searching around and basic reasoning, I shouldn't be very far off from where I need to be.  There's just something I'm doing wrong with handling that highest level.</p>