Class NpgsqlLengthCache
- Namespace
- Npgsql
- Assembly
- Npgsql.dll
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.
public sealed class NpgsqlLengthCache
- Inheritance
-
NpgsqlLengthCache
- Inherited Members
Methods
Get()
Retrieves a length value previously stored in the cache via Set(int). Called at the writing phase, after validation has already occurred and the length cache is populated.
public int Get()
Returns
Set(int)
Stores a length value in the cache, to be fetched later via Get(). Called at the ValidateAndGetLength<TAny>(TAny, ref NpgsqlLengthCache, NpgsqlParameter) phase.
public int Set(int len)
Parameters
len
int
Returns
- int
The length parameter.