Exemplo n.º 1
0
        public MigrationManager(
            IFilteringMigrationSource filteringMigrationSource,
            IMigrationRunner migrationRunner,
            IMigrationRunnerConventions migrationRunnerConventions,
            IMigrationContext migrationContext,
            ITypeFinder typeFinder,
            IVersionLoader versionLoader)
        {
            _typeMapping = new Dictionary <Type, Action <ICreateTableColumnAsTypeSyntax> >()
            {
                [typeof(int)]      = c => c.AsInt32(),
                [typeof(string)]   = c => c.AsString(int.MaxValue).Nullable(),
                [typeof(bool)]     = c => c.AsBoolean(),
                [typeof(decimal)]  = c => c.AsDecimal(18, 4),
                [typeof(DateTime)] = c => c.AsDateTime2(),
                [typeof(byte[])]   = c => c.AsBinary(int.MaxValue),
                [typeof(Guid)]     = c => c.AsGuid()
            };

            _filteringMigrationSource   = filteringMigrationSource;
            _migrationRunner            = migrationRunner;
            _migrationRunnerConventions = migrationRunnerConventions;
            _migrationContext           = migrationContext;
            _typeFinder    = typeFinder;
            _versionLoader = versionLoader;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProfileSource"/> class.
 /// </summary>
 /// <param name="source">The assembly source</param>
 /// <param name="conventions">The migration runner conventios</param>
 public ProfileSource(
     [NotNull] IFilteringMigrationSource source,
     [NotNull] IMigrationRunnerConventions conventions)
 {
     _source      = source;
     _conventions = conventions;
 }
Exemplo n.º 3
0
 public NamespaceMigrationInformationLoader(string @namespace,
                                            IFilteringMigrationSource source, DefaultMigrationInformationLoader inner)
 {
     _namespace = @namespace;
     _source    = source;
     _inner     = inner;
 }
Exemplo n.º 4
0
        public MigrationManager(
            IFilteringMigrationSource filteringMigrationSource,
            IMigrationRunner migrationRunner,
            IMigrationRunnerConventions migrationRunnerConventions)
        {
            _versionLoader = new Lazy <IVersionLoader>(() => EngineContext.Current.Resolve <IVersionLoader>());

            _filteringMigrationSource   = filteringMigrationSource;
            _migrationRunner            = migrationRunner;
            _migrationRunnerConventions = migrationRunnerConventions;
        }
        public MigrationManager(
            IFilteringMigrationSource filteringMigrationSource,
            IMigrationRunner migrationRunner,
            IMigrationRunnerConventions migrationRunnerConventions,
            Lazy <IVersionLoader> versionLoader)
        {
            _versionLoader = versionLoader;

            _filteringMigrationSource   = filteringMigrationSource;
            _migrationRunner            = migrationRunner;
            _migrationRunnerConventions = migrationRunnerConventions;
        }
Exemplo n.º 6
0
 public DbSchemaProfileSource(IFilteringMigrationSource source, IMigrationRunnerConventions conventions)
 {
     _source      = source;
     _conventions = conventions;
 }