public SqlItemResultDataReader(IDbConnection connection, string sqlQuery, SearchParameter searchParameter)
        {
            _command = connection.CreateCommand();

            _command.CommandType = CommandType.Text;
            _command.CommandText = sqlQuery;
            var parameter = _command.CreateParameter();

            parameter.Direction     = ParameterDirection.Input;
            parameter.ParameterName = searchParameter.ParameterName;
            parameter.DbType        = DbType.String;
            parameter.Value         = searchParameter.ParameterValue;
            _command.Parameters.Add(parameter);

            EnsureConnectionOpen(connection);

            _reader = _command.ExecuteReader();

            _idColumnIndex     = _reader.GetOrdinal("Id");
            _weightColumnIndex = _reader.GetOrdinal("Weight");
        }
 public ISqlItemResultDataReader Create(string sqlQuery, SearchParameter searchParameter)
 {
     return(new SqlItemResultDataReader(_connection, sqlQuery, searchParameter));
 }