コード例 #1
0
        public DefaultConventionSet(IRunnerContext runnerContext)
        {
            var schemaConvention =
                new DefaultSchemaConvention(new DefaultSchemaNameConvention(runnerContext?.DefaultSchemaName));

            ColumnsConventions = new List <IColumnsConvention>()
            {
                new DefaultPrimaryKeyNameConvention(),
            };

            ConstraintConventions = new List <IConstraintConvention>()
            {
                new DefaultConstraintNameConvention(),
                schemaConvention,
            };

            ForeignKeyConventions = new List <IForeignKeyConvention>()
            {
                new DefaultForeignKeyNameConvention(),
                schemaConvention,
            };

            IndexConventions = new List <IIndexConvention>()
            {
                new DefaultIndexNameConvention(),
                schemaConvention,
            };

            SequenceConventions = new List <ISequenceConvention>()
            {
                schemaConvention,
            };

            AutoNameConventions = new List <IAutoNameConvention>()
            {
                new DefaultAutoNameConvention(),
            };

            SchemaConvention   = schemaConvention;
            RootPathConvention = new DefaultRootPathConvention(runnerContext?.WorkingDirectory);
        }
コード例 #2
0
        // ReSharper disable once MemberCanBePrivate.Global
        public DefaultConventionSet([CanBeNull] string defaultSchemaName, [CanBeNull] string workingDirectory)
        {
            var schemaConvention =
                new DefaultSchemaConvention(new DefaultSchemaNameConvention(defaultSchemaName));

            ColumnsConventions = new List <IColumnsConvention>()
            {
                new DefaultPrimaryKeyNameConvention(),
            };

            ConstraintConventions = new List <IConstraintConvention>()
            {
                new DefaultConstraintNameConvention(),
                schemaConvention,
            };

            ForeignKeyConventions = new List <IForeignKeyConvention>()
            {
                new DefaultForeignKeyNameConvention(),
                schemaConvention,
            };

            IndexConventions = new List <IIndexConvention>()
            {
                new DefaultIndexNameConvention(),
                schemaConvention,
            };

            SequenceConventions = new List <ISequenceConvention>()
            {
                schemaConvention,
            };

            AutoNameConventions = new List <IAutoNameConvention>()
            {
                new DefaultAutoNameConvention(),
            };

            SchemaConvention   = schemaConvention;
            RootPathConvention = new DefaultRootPathConvention(workingDirectory);
        }