MongoDB.Bson.Serialization.Conventions.ConventionProfile.SetIgnoreExtraElementsConvention C# (CSharp) Method

SetIgnoreExtraElementsConvention() public method

Sets the ignore extra elements convention.
public SetIgnoreExtraElementsConvention ( IIgnoreExtraElementsConvention convention ) : ConventionProfile
convention IIgnoreExtraElementsConvention An ignore extra elements convention.
return ConventionProfile
        public ConventionProfile SetIgnoreExtraElementsConvention(IIgnoreExtraElementsConvention convention)
        {
            IgnoreExtraElementsConvention = convention;
            return this;
        }

Usage Example

 public static void ConfigureMapping()
 {
     var conventionsProfile = new ConventionProfile();
     conventionsProfile.SetIgnoreExtraElementsConvention(new AlwaysIgnoreExtraElementsConvention());
     conventionsProfile.SetIdMemberConvention(new NamedIdMemberConvention("Id"));
     BsonClassMap.RegisterConventions(conventionsProfile, t => typeof(ISagaEntity).IsAssignableFrom(t));
 }
All Usage Examples Of MongoDB.Bson.Serialization.Conventions.ConventionProfile::SetIgnoreExtraElementsConvention