title: C# MongoDb deserialization of an abstract sub-document
body: <p>Prefix: Using .net 4.6.1, C# 7, C# MongoDb 2.5.0</p>
  
  <p>Issue in general:</p>
  
  <p>I have a small class which contains a field of an abstract type.</p>
  
  <pre><code>[BsonIgnoreExtraElements(true)]
  public sealed class FatherAlmighty
  {
      [BsonId]
      public ObjectId Id;
  
      public MyAbstract Item;
  }
  </code></pre>
  
  <p>also, this <code>MyAbstract</code> is obviously an abstract class which has at least 2 inheriting classes.</p>
  
  <pre><code>[BsonIgnoreExtraElements(true)]
  [BsonKnownTypes(typeof(Child1))]
  public abstract class MyAbstract
  {
      public string DontCare;
  }
  
  [BsonIgnoreExtraElements(true)]
  public sealed class Child1 : MyAbstract
  {
      public string ChildishField;
  }
  </code></pre>
  
  <p>The <code>BsonKnownTypes</code> contains every single type of class inherited from <code>MyAbstract</code> but I wrote only 1 for simplicity matter.</p>
  
  <p>What I need to happen: Because of architecture demands, I need to be able to add (only add) fields to <code>Child1</code> on mongo and then deploy an application version to use this value.</p>
  
  <p>Problem: Whenever I add a value to document, before application deploy, im getting a deserialization issues.
  For example, If I add the field <code>AnotherChildishField</code> in my document (attention to document and <strong>not</strong> class) with a value of "myStr", I expect everything to work by ignoring this newly added field, but errors are raining cats and dogs.</p>
  
  <blockquote>
    <p>An error occurred while deserializing the Item field of class &lt;.....>: Element 'AnotherChildishField' does not match any field or property of class &lt;.....></p>
  </blockquote>
  
  <p>What am I missing? I added IgnoreExtraElements for almost everything.</p>