/// <summary> /// Initializes a new instance of the <see cref="Engine"/> class. /// </summary> public Engine() { Migrations = new Dictionary <long, Type>(); SqlProviderFactory = new SqlProviderFactory(); HistoryRepository = new MigrationHistoryRepository(); SqlProcessor = new DatabaseSqlProcessor(); }
public void SetSqlProviderFactoryTest() { SqlProviderFactory pf = new SqlProviderFactory(); Target.SetSqlProviderFactory(pf); Assert.AreEqual(pf, Target.SqlProviderFactory); }
/// <summary> /// Creates a new migration context. /// </summary> /// <returns>The context.</returns> protected virtual MigrationContext CreateContext() { return(new MigrationContext() { ConnetionString = ConnectionString, ProviderInvariantName = ProviderInvariantName, Connection = OpenConnection(), SqlProvider = SqlProviderFactory.GetProvider(ProviderInvariantName), SqlProcessor = SqlProcessor }); }
/// <summary> /// Sets the SQL provider factory. /// </summary> /// <param name="factory">The SQL provider factory.</param> /// <returns>The engine.</returns> public virtual Engine SetSqlProviderFactory(SqlProviderFactory factory) { SqlProviderFactory = factory; return(this); }
/// <summary> /// Registers the provider of the specified <see cref="Type"/> at /// the current <see cref="ProviderFactory"/>. /// </summary> /// <param name="providerType">Type of the provider.</param> /// <returns>The engine.</returns> public virtual Engine RegisterProvider(Type providerType) { SqlProviderFactory.RegisterProvider(providerType); return(this); }
/// <summary> /// Scans the specified <paramref name="assembly"/> for migrations and SQL providers. /// </summary> /// <param name="assembly">The assembly to add.</param> /// <returns>The engine.</returns> public virtual Engine AddAssembly(Assembly assembly) { FindMigrations(assembly); SqlProviderFactory.RegisterProviders(assembly); return(this); }