Exemplo n.º 1
0
        private DbCommand CreateCommand(string sqlCommand, params DbParameter[] parameters)
        {
            var command = _executor.CreateCommand();

            foreach (var parameter in parameters)
            {
                command.Parameters.Add(parameter);
            }
            command.CommandText = sqlCommand;
            command.CommandType = CommandType.Text;
            return(command);
        }
        private DbCommand CreateCommand(string sqlCommand, params DbParameter[] parameters)
        {
            IDatabaseExecutor db = this.databaseExecutor();

            DbCommand command = db.CreateCommand();

            foreach (DbParameter parameter in parameters)
            {
                command.Parameters.Add(value: parameter);
            }

            command.CommandText = sqlCommand;
            command.CommandType = CommandType.Text;
            return(command);
        }