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
System.Object
NpgsqlLengthCache
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlLengthCache
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 |
---|---|
System.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 |
---|---|---|
System.Int32 | len |
Returns
Type | Description |
---|---|
System.Int32 | The length parameter. |