title: How can I use the object name in a JSON array as a property value using JSON.NET?
body: <p>I have the following JSON chunk (extracted from the full JSON in order to simplify the question): </p>
  
  <pre><code> "statistics": [
    {
      "Strength": {
        "min": 16,
        "max": 20
      }
    },
    {
      "Dexterity": {
        "min": 16,
        "max": 20
      }
    }]
  </code></pre>
  
  <p>I'd like to deserialize the "statistics" array into a C# array of "Statistic" objects, but I can"t find how to do it... The key of each statistic object can be anything : "Strength","Luck","Dexterity" and so on, and each of those keys are unique.</p>
  
  <p>The C# data object would be like this : </p>
  
  <pre><code>public class Container
  {
      public Statistic[] Statistics { get; set; }
  }
  
  public class Statistic
  {
      //Contains the name of the statistic
      public string Name { get; set; }
      public int Min { get; set; }
      public int Max { get; set; }
  }
  </code></pre>
  
  <p>Maybe can I use some kind of polymorphism by removing the <code>Name</code> property and creating all possible classes of statistics, but it deafeats the adaptability of my code.</p>
  
  <p>Thank you a lot.</p>