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

SetIdMemberConvention() public method

Sets the Id member convention.
public SetIdMemberConvention ( IIdMemberConvention convention ) : ConventionProfile
convention IIdMemberConvention An Id member convention.
return ConventionProfile
        public ConventionProfile SetIdMemberConvention(IIdMemberConvention convention)
        {
            IdMemberConvention = 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::SetIdMemberConvention