title: Json.net serialize specific private field
body: <p>I have the following class:</p>
  
  <pre><code>public class TriGrid
  {
      private List&lt;HexTile&gt; _hexes;
      //other private fields...
      //other public proprerties
  }
  </code></pre>
  
  <p>My goal is to serialize only the <code>_hexes</code> field, so I created the following ContractResolver:</p>
  
  <pre><code>internal class TriGridContractResolver : DefaultContractResolver
  {
      protected override List&lt;MemberInfo&gt; GetSerializableMembers(Type objectType)
      {
          return new List&lt;MemberInfo&gt; { objectType.GetMember("_hexes", BindingFlags.NonPublic | BindingFlags.Instance)[0] };
      }
  }
  </code></pre>
  
  <p>and when I want to serialize an instance of TriGrid I do:</p>
  
  <pre><code>var settings = new JsonSerializerSettings()
  {
      ContractResolver = new TriGridContractResolver()
  };
  var json = JsonConvert.SerializeObject(someTriGrid, settings);
  string strintJson = json.ToString();
  </code></pre>
  
  <p>but when I check the value of <code>strintJson</code> is always <code>"{}"</code>. The <code>_hexes</code> has elements, it is not empty. If I serialize one particular <code>HexTile</code> it works as expected. What I am doing wrong here?</p>