/// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual ConventionSet AddConventions(ConventionSet conventionSet)
        {
            var logger = Dependencies.Logger;

            ValueGeneratorConvention valueGeneratorConvention = new RelationalValueGeneratorConvention(logger);

            ReplaceConvention(conventionSet.BaseEntityTypeChangedConventions, valueGeneratorConvention);
            ReplaceConvention(conventionSet.PrimaryKeyChangedConventions, valueGeneratorConvention);
            ReplaceConvention(conventionSet.ForeignKeyAddedConventions, valueGeneratorConvention);
            ReplaceConvention(conventionSet.ForeignKeyRemovedConventions, valueGeneratorConvention);

            var relationalColumnAttributeConvention = new RelationalColumnAttributeConvention(logger);

            conventionSet.PropertyAddedConventions.Add(relationalColumnAttributeConvention);

            var sharedTableConvention = new SharedTableConvention(logger);

            var discriminatorConvention = new DiscriminatorConvention(logger);

            conventionSet.EntityTypeAddedConventions.Add(new RelationalTableAttributeConvention(logger));
            conventionSet.EntityTypeRemovedConventions.Add(discriminatorConvention);
            conventionSet.BaseEntityTypeChangedConventions.Add(discriminatorConvention);
            conventionSet.BaseEntityTypeChangedConventions.Add(
                new TableNameFromDbSetConvention(Dependencies.Context?.Context, Dependencies.SetFinder, logger));
            conventionSet.PropertyFieldChangedConventions.Add(relationalColumnAttributeConvention);
            conventionSet.PropertyAnnotationChangedConventions.Add((RelationalValueGeneratorConvention)valueGeneratorConvention);

            conventionSet.ModelBuiltConventions.Add(sharedTableConvention);

            conventionSet.ModelAnnotationChangedConventions.Add(new RelationalDbFunctionConvention(logger));

            return(conventionSet);
        }
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public virtual ConventionSet AddConventions(ConventionSet conventionSet)
        {
            var typeMapper = Dependencies.TypeMapper;

            RelationshipDiscoveryConvention relationshipDiscoveryConvention
                = new RelationalRelationshipDiscoveryConvention(typeMapper);

            InversePropertyAttributeConvention inversePropertyAttributeConvention
                = new RelationalInversePropertyAttributeConvention(typeMapper);

            ReplaceConvention(
                conventionSet.EntityTypeAddedConventions,
                (PropertyDiscoveryConvention) new RelationalPropertyDiscoveryConvention(typeMapper));
            ReplaceConvention(conventionSet.EntityTypeAddedConventions, inversePropertyAttributeConvention);
            ReplaceConvention(conventionSet.EntityTypeAddedConventions, relationshipDiscoveryConvention);

            ReplaceConvention(conventionSet.EntityTypeIgnoredConventions, inversePropertyAttributeConvention);

            ReplaceConvention(conventionSet.BaseEntityTypeSetConventions, inversePropertyAttributeConvention);
            ReplaceConvention(conventionSet.BaseEntityTypeSetConventions, relationshipDiscoveryConvention);

            ReplaceConvention(conventionSet.EntityTypeMemberIgnoredConventions, inversePropertyAttributeConvention);
            ReplaceConvention(conventionSet.EntityTypeMemberIgnoredConventions, relationshipDiscoveryConvention);

            ReplaceConvention(
                conventionSet.ForeignKeyAddedConventions,
                (ForeignKeyAttributeConvention) new RelationalForeignKeyAttributeConvention(typeMapper));

            ReplaceConvention(conventionSet.NavigationAddedConventions, inversePropertyAttributeConvention);
            ReplaceConvention(conventionSet.NavigationAddedConventions, relationshipDiscoveryConvention);

            ReplaceConvention(conventionSet.NavigationRemovedConventions, relationshipDiscoveryConvention);

            ReplaceConvention(
                conventionSet.ModelBuiltConventions,
                (PropertyMappingValidationConvention) new RelationalPropertyMappingValidationConvention(typeMapper));

            var relationalColumnAttributeConvention = new RelationalColumnAttributeConvention();

            conventionSet.PropertyAddedConventions.Add(relationalColumnAttributeConvention);

            conventionSet.EntityTypeAddedConventions.Add(new RelationalTableAttributeConvention());

            conventionSet.BaseEntityTypeSetConventions.Add(new DiscriminatorConvention());

            conventionSet.BaseEntityTypeSetConventions.Add(
                new TableNameFromDbSetConvention(Dependencies.Context?.Context, Dependencies.SetFinder));

            conventionSet.PropertyFieldChangedConventions.Add(relationalColumnAttributeConvention);

            return(conventionSet);
        }