Наследование: System.Data.Common.DbConnection
Пример #1
0
        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.Oracle_Managed_ODP:
                case DbProviderNames.NLite_Data_Oracle:
                    connection = new ManagedODPConnectionWrapper(this, connection);
                    break;

                case DbProviderNames.SQLite:
                    connection = new DbConnectionWrapper(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);
        }
Пример #2
0
        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;
        }
Пример #3
0
 public TransactionWrapper(DbConnectionWrapper connection, DbTransaction tran)
 {
     this.Inner = tran;
     Connection = connection;
     IsActive   = true;
 }
Пример #4
0
 public TransactionWrapper(DbConnectionWrapper connection, DbTransaction tran)
 {
     this.Inner = tran;
     Connection = connection;
     IsActive = true;
 }