private IDbContext CreateDbContext(IDbContext ctx) { connection.StateChange += new StateChangeEventHandler(connection_StateChange); if (!(connection is DbConnectionWrapper)) { switch (DbProviderName) { case DbProviderNames.Oracle_ODP: connection = new ODPConnectionWrapper(this, connection); break; case DbProviderNames.SQLite: connection = new SQLiteConnectionWrapper(this, connection) { IsFileDatabase = true }; break; case DbProviderNames.SqlCe40: case DbProviderNames.SqlCe35: case DbProviderNames.Oledb: connection = new DbConnectionWrapper(this, connection) { IsFileDatabase = true }; break; default: connection = new DbConnectionWrapper(this, connection); break; } } ctx = new InternalDbContext(this, connection); return(ctx); }
private IDbContext CreateDbContext(IDbContext ctx) { connection.StateChange += new StateChangeEventHandler(connection_StateChange); if (!(connection is DbConnectionWrapper)) { switch (DbProviderName) { case DbProviderNames.Oracle_ODP: connection = new ODPConnectionWrapper(this,connection); break; case DbProviderNames.SQLite: connection = new SQLiteConnectionWrapper(this, connection) { IsFileDatabase = true }; break; case DbProviderNames.SqlCe40: case DbProviderNames.SqlCe35: case DbProviderNames.Oledb : connection = new DbConnectionWrapper(this, connection) { IsFileDatabase = true }; break; default: connection = new DbConnectionWrapper(this,connection); break; } } ctx = new InternalDbContext(this, connection); return ctx; }