title: Unknown discriminator value C# Mongo
body: <p>I am able to save my class to mongo but I am getting an error deserializing it.</p>
  
  <p>I am getting an error:</p>
  
  <blockquote>
    <p>'MongoDB.Bson.BsonSerializationException : Unknown discriminator value 'ProductPropertyDefinition'.' </p>
  </blockquote>
  
  <p>I need help.  How to tell mongo to deserialize this correctly?</p>
  
  <pre><code>public class Product
  {
      [BsonId]
      [BsonRepresentation(BsonType.ObjectId)]
      public string Id { get; set; }
  
      public ProductPropertyDefinitionCollection ProductProperties { get; set; }
  }
  
  public class ProductPropertyDefinitionCollection : CollectionBase
  {
      public ProductPropertyDefinition this[int index]
      {
          get
          {
              return (ProductPropertyDefinition)List[index];
          }
          set
          {
              List[index] = value;
          }
      }
  
      public ProductPropertyDefinition this[string name]
      {
          get
          {
              return GetByName(name);
          }
      }
  
      public int Add(ProductPropertyDefinition value)
      {
          return List.Add(value);
      }
  
      public void Remove(ProductPropertyDefinition value)
      {
          List.Remove(value);
      }
  
      public bool Contains(ProductPropertyDefinition value)
      {
          return List.Contains(value);
      }
  
      private ProductPropertyDefinition GetByName(string propertyName)
      {
          ProductPropertyDefinition profileItem = null;
  
          foreach (ProductPropertyDefinition profileProperty in InnerList)
          {
              if (profileProperty.PropertyName == propertyName)
              {
                  profileItem = profileProperty;
              }
          }
          return profileItem;
      }
  }
  </code></pre>