コード例 #1
0
        /// <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 MyCatDatabaseCreator(
            [NotNull] MyCatRelationalConnection connection,
            [NotNull] IMigrationsModelDiffer modelDiffer,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IModel model,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IDbContextOptions options,
            [NotNull] MyCatSchemaGenerator schemaGenerator)
            : base(model, connection, modelDiffer, migrationsSqlGenerator, migrationCommandExecutor)
        {
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));

            _connection             = connection;
            _migrationsSqlGenerator = migrationsSqlGenerator;
            _rawSqlCommandBuilder   = rawSqlCommandBuilder;
            _options         = options;
            _schemaGenerator = schemaGenerator;
            _schemaGenerator.CommitSchema(_connection);
        }
コード例 #2
0
        /// <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 MyCatMigrator(
            [NotNull] IMigrationsAssembly migrationsAssembly,
            [NotNull] IHistoryRepository historyRepository,
            [NotNull] IDatabaseCreator databaseCreator,
            [NotNull] IMigrationsSqlGenerator migrationsSqlGenerator,
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IMigrationCommandExecutor migrationCommandExecutor,
            [NotNull] IRelationalConnection connection,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] ILogger <Migrator> logger,
            [NotNull] IDatabaseProviderServices providerServices,
            [NotNull] IDbContextOptions options,
            [NotNull] MyCatSchemaGenerator schemaCreator)
            : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, logger, providerServices)
        {
            Check.NotNull(migrationsAssembly, nameof(migrationsAssembly));
            Check.NotNull(historyRepository, nameof(historyRepository));
            Check.NotNull(databaseCreator, nameof(databaseCreator));
            Check.NotNull(migrationsSqlGenerator, nameof(migrationsSqlGenerator));
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(migrationCommandExecutor, nameof(migrationCommandExecutor));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(providerServices, nameof(providerServices));

            _migrationsAssembly       = migrationsAssembly;
            _historyRepository        = (MyCatHistoryRepository)historyRepository;
            _databaseCreator          = (MyCatDatabaseCreator)databaseCreator;
            _migrationsSqlGenerator   = migrationsSqlGenerator;
            _rawSqlCommandBuilder     = rawSqlCommandBuilder;
            _migrationCommandExecutor = migrationCommandExecutor;
            _connection          = (MyCatRelationalConnection)connection;
            _sqlGenerationHelper = sqlGenerationHelper;
            _logger         = logger;
            _activeProvider = providerServices.InvariantName;
            _options        = options;
            _schemaCreator  = schemaCreator;
        }