Search Results for

    Show / Hide Table of Contents

    Class NpgsqlLengthCache

    An array of cached lengths for the parameters sending process.

    When sending parameters, lengths need to be calculated more than once (once for Bind, once for an array, once for the string within that array). This cache optimized that. Lengths are added to the cache, and then retrieved at the same order.

    Inheritance
    Object
    NpgsqlLengthCache
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql.Internal.TypeHandling
    Assembly: Npgsql.dll
    Syntax
    public sealed class NpgsqlLengthCache

    Constructors

    NpgsqlLengthCache()

    Declaration
    public NpgsqlLengthCache()

    NpgsqlLengthCache(Int32)

    Declaration
    public NpgsqlLengthCache(int capacity)
    Parameters
    Type Name Description
    Int32 capacity

    Fields

    IsPopulated

    Declaration
    public bool IsPopulated
    Field Value
    Type Description
    Boolean

    Lengths

    Declaration
    public List<int> Lengths
    Field Value
    Type Description
    List<Int32>

    Position

    Declaration
    public int Position
    Field Value
    Type Description
    Int32

    Methods

    Get()

    Retrieves a length value previously stored in the cache via Set(Int32). Called at the writing phase, after validation has already occurred and the length cache is populated.

    Declaration
    public int Get()
    Returns
    Type Description
    Int32

    Set(Int32)

    Stores a length value in the cache, to be fetched later via Get(). Called at the ValidateAndGetLength<TAny>(TAny, ref NpgsqlLengthCache, NpgsqlParameter) phase.

    Declaration
    public int Set(int len)
    Parameters
    Type Name Description
    Int32 len
    Returns
    Type Description
    Int32

    The length parameter.

    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team