title: Reading JSON with a property name that changes
body: <p>I'm trying to ready a JSON file with contents similar to this:</p>
  
  <pre><code>{
    "result": {
      "1357": {
        "icon": "smiley-face",
        "name": "happy"
      },
      "success": true
    }
  }
  </code></pre>
  
  <p>This example below works but the problem I'm having is that the property name for <code>classid</code> is always different.  How can I deserialize the <code>classid</code> without knowing the property name?</p>
  
  <pre><code>using System;
  using System.IO;
  using Newtonsoft.Json;
  
  public class ClassId
  {
      [JsonProperty("icon")]
      public string Icon { get; set; }
  
      [JsonProperty("name")]
      public string Name { get; set; }
  }
  
  public class Result
  {
      [JsonProperty("1357")] // this key is always different
      public ClassId classid { get; set; }
  
      [JsonProperty("success")]
      public bool Success { get; set; }
  }
  
  public class Example
  {
      [JsonProperty("result")]
      public Result Result { get; set; }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          var json = File.ReadAllText("test.json");
          var container = JsonConvert.DeserializeObject&lt;Example&gt;(json);
          Console.WriteLine(container.Result.classid.Icon);
      }
  }
  </code></pre>