Beispiel #1
0
        public DbCache(TConnection connection, DecorateDbObjects decorator, String schema, String table, AddTileCommand atc, RemoveTileCommand rtc, FindTileCommand ftc)
        {
            Connection = connection;
            Schema     = schema;
            Table      = table;

            _decorator = decorator;

            _addTileCommand    = atc(connection, decorator, schema, table);
            _removeTileCommand = rtc(connection, decorator, schema, table);
            _findTileCommand   = ftc(connection, decorator, schema, table);

            if (Connection.State == ConnectionState.Open)
            {
                Connection.Close();
            }
        }
Beispiel #2
0
        public DbCache(TConnection connection, DecorateDbObjects decorator, String schema, String table, AddTileCommand atc, RemoveTileCommand rtc, FindTileCommand ftc)
        {
            Connection = connection;
            Schema     = schema;
            Table      = table;

            _decorator = decorator;

            if (atc != null)
            {
                _addTileCommand = atc(connection, decorator, schema, table);
            }

            if (rtc != null)
            {
                _removeTileCommand = rtc(connection, decorator, schema, table);
            }

            if (ftc == null)
            {
                ftc = BasicFindTileCommand;
            }

            _findTileCommand = ftc(connection, decorator, schema, table);

            _bank = new BankOfSelectTileCommands(_findTileCommand);

            if (Connection.State == ConnectionState.Open)
            {
                Connection.Close();
            }
        }