Table of Contents

Class NpgsqlParameter<T>

Namespace
Npgsql
Assembly
Npgsql.dll

A generic version of NpgsqlParameter which provides more type safety and avoids boxing of value types. Use TypedValue instead of Value.

public sealed class NpgsqlParameter<T> : NpgsqlParameter, IDbDataParameter, IDataParameter, ICloneable

Type Parameters

T

The type of the value that will be stored in the parameter.

Inheritance
NpgsqlParameter<T>
Implements
Inherited Members

Constructors

NpgsqlParameter()

Initializes a new instance of NpgsqlParameter<T>.

public NpgsqlParameter()

NpgsqlParameter(string, NpgsqlDbType)

Initializes a new instance of NpgsqlParameter<T> with a parameter name and type.

public NpgsqlParameter(string parameterName, NpgsqlDbType npgsqlDbType)

Parameters

parameterName string
npgsqlDbType NpgsqlDbType

NpgsqlParameter(string, DbType)

Initializes a new instance of NpgsqlParameter<T> with a parameter name and type.

public NpgsqlParameter(string parameterName, DbType dbType)

Parameters

parameterName string
dbType DbType

NpgsqlParameter(string, T)

Initializes a new instance of NpgsqlParameter<T> with a parameter name and value.

public NpgsqlParameter(string parameterName, T value)

Parameters

parameterName string
value T

Properties

TypedValue

Gets or sets the strongly-typed value of the parameter.

public T? TypedValue { get; set; }

Property Value

T

Value

Gets or sets the value of the parameter. This delegates to TypedValue.

public override object? Value { get; set; }

Property Value

object