title: C# deserializing JSON to Dictionary<int,Tuple<string,int>>
body: <p>I have a JSON file with the structure:</p>
  
  <pre><code>[ {"unit_id": {"type":[string],"customer_id":[int]} },
  
  ...,
  
  ...]
  </code></pre>
  
  <p>And I want to convert it to a dictionary (or anything useful) of the structure:</p>
  
  <pre><code>Dictionary&lt;int,Tuple&lt;string,int&gt;&gt;
  </code></pre>
  
  <p>I am trying the following:</p>
  
  <pre><code>Dictionary&lt;int, Tuple&lt;string,int&gt;&gt; units =
  JsonConvert.DeserializeObject&lt;Dictionary&lt;int, Tuple&lt;string, int&gt;&gt;&gt;
  (File.ReadAllText(jsonFile));
  </code></pre>
  
  <p>Which fails because the file can't be deserialized into that structure. I have also tried creating a class:</p>
  
  <pre><code>class Unit{
      public int unitID;
      public Tuple&lt;string, int&gt; details;
  }
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>List&lt;Unit&gt; units = JsonConvert.DeserializeObject&lt;List&lt;Unit&gt;&gt;(File.ReadAllText(jsonFile));
  </code></pre>
  
  <p>Which doesn't fail, but doesn't fill the list with any values.</p>
  
  <p>Thanks</p>