ValueTask <T> Read <T>(NpgsqlDbType type, bool async, CancellationToken cancellationToken = default)
    {
        CheckDisposed();
        if (_column == -1 || _column == NumColumns)
        {
            throw new InvalidOperationException("Not reading a row");
        }

        var handler = _typeHandlerCache[_column];

        if (handler == null)
        {
            handler = _typeHandlerCache[_column] = _typeMapper.ResolveByNpgsqlDbType(type);
        }

        return(DoRead <T>(handler, async, cancellationToken));
    }
Exemple #2
0
 public NpgsqlTypeHandler ResolveNpgsqlDbType()
 => _typeMapper.ResolveByNpgsqlDbType(NpgsqlDbType.Integer);