Ejemplo n.º 1
0
        public IDbCommand Build(IDbConnectionWrapper connection)
        {
            var command = connection.CreateCommand();

            if (_commandText != null)
            {
                command.CommandText = _commandText;
            }
            if (_commandTimeout != null)
            {
                command.CommandTimeout = _commandTimeout.Value;
            }
            if (_commandType != null)
            {
                command.CommandType = _commandType.Value;
            }

            foreach (var parameter in _parameters)
            {
                var dbParameter = command.CreateParameter();
                dbParameter.ParameterName = parameter.Key;
                dbParameter.Value         = parameter.Value ?? DBNull.Value;
                command.Parameters.Add(dbParameter);
            }

            return(command);
        }
Ejemplo n.º 2
0
        private DbCommand BuildDbCommand(IDbConnectionWrapper connection)
        {
            var command = Build(connection);

            if (!(command is DbCommand))
            {
                throw new NotSupportedException("Command must be DbCommand");
            }
            return(command as DbCommand);
        }
Ejemplo n.º 3
0
 public DatabaseStub(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Ejemplo n.º 4
0
 internal SQLiteDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Ejemplo n.º 5
0
 internal OdbcDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Ejemplo n.º 6
0
 protected Database(IDbConnectionWrapper connection)
 {
     _connection = connection;
 }
Ejemplo n.º 7
0
 internal PostgresDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }