Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #3
0
 public DatabaseStub(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Beispiel #4
0
 internal SQLiteDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Beispiel #5
0
 internal OdbcDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }
Beispiel #6
0
 protected Database(IDbConnectionWrapper connection)
 {
     _connection = connection;
 }
Beispiel #7
0
 internal PostgresDatabase(IDbConnectionWrapper connection)
     : base(connection)
 {
 }