title: C# MongoDB not serializing System.Security.Claims.Claim
body: <p>I seem to be unable to serialize <code>Claim</code> - what am I doing wrong? Other object serializations using this method works fine.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>var client = new MongoClient("mongodb://localhost:27017");
  var database = client.GetDatabase("TEST");
  var collection = database.GetCollection&lt;Claim&gt;("Claims");
  
  var payload = new Claim("name", "value");
  collection.InsertOne(payload);
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <p>An object gets inserted into MongoDB but nothing other than <code>_id</code> gets set/populated.</p>
  
  <p><a href="https://i.stack.imgur.com/Y6FKY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y6FKY.png" alt="enter image description here"></a></p>
  
  <p><em>Using .NET Core 2.0.x and MongoDB.Driver 2.5.0.</em></p>
  
  <p><strong>Update 1</strong></p>
  
  <p>Mapping members manually seems to work; it's just when it's auto-mapped that it seems to fail.</p>
  
  <pre><code>BsonClassMap.RegisterClassMap&lt;Claim&gt;(cm =&gt;
  {
      cm.SetIgnoreExtraElements(true);
      cm.MapMember(c =&gt; c.Issuer);
      cm.MapMember(c =&gt; c.OriginalIssuer);
      cm.MapMember(c =&gt; c.Properties);
      cm.MapMember(c =&gt; c.Subject);
      cm.MapMember(c =&gt; c.Type);
      cm.MapMember(c =&gt; c.Value);
      cm.MapMember(c =&gt; c.ValueType);
      cm.MapCreator(c =&gt; new Claim(c.Type, c.Value, c.ValueType, c.Issuer, c.OriginalIssuer, c.Subject));
  });
  </code></pre>