Пример #1
0
 public static IConventionSet Create(DefaultSchemaConvention schemaConvention, string rootPath)
 {
     return(new ConventionSet
     {
         SchemaConvention = schemaConvention,
         RootPathConvention = new DefaultRootPathConvention(rootPath),
         ConstraintConventions =
         {
             new DefaultConstraintNameConvention(),
             schemaConvention,
         },
         ColumnsConventions =
         {
             new DefaultPrimaryKeyNameConvention(),
         },
         ForeignKeyConventions =
         {
             new DefaultForeignKeyNameConvention(),
             schemaConvention,
         },
         IndexConventions =
         {
             new DefaultIndexNameConvention(),
             schemaConvention,
         },
         SequenceConventions =
         {
             schemaConvention,
         },
         AutoNameConventions =
         {
             new DefaultAutoNameConvention(),
         }
     });
 }
        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);
        }
        // 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);
        }