Class NpgsqlParameter<T>
A generic version of NpgsqlParameter which provides more type safety and avoids boxing of value types. Use TypedValue instead of Value.
Implements
IDbDataParameter
ICloneable
Inherited Members
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlParameter<T> : NpgsqlParameter, IDbDataParameter, ICloneable
Type Parameters
Name | Description |
---|---|
T | The type of the value that will be stored in the parameter. |
Constructors
| Improve this Doc View SourceNpgsqlParameter()
Initializes a new instance of NpgsqlParameter<T>.
Declaration
public NpgsqlParameter()
NpgsqlParameter(string, T)
Initializes a new instance of NpgsqlParameter<T> with a parameter name and value.
Declaration
public NpgsqlParameter(string parameterName, T value)
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | |
T | value |
NpgsqlParameter(string, DbType)
Initializes a new instance of NpgsqlParameter<T> with a parameter name and type.
Declaration
public NpgsqlParameter(string parameterName, DbType dbType)
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | |
DbType | dbType |
NpgsqlParameter(string, NpgsqlDbType)
Initializes a new instance of NpgsqlParameter<T> with a parameter name and type.
Declaration
public NpgsqlParameter(string parameterName, NpgsqlDbType npgsqlDbType)
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | |
NpgsqlDbType | npgsqlDbType |
Properties
| Improve this Doc View SourceTypedValue
Gets or sets the strongly-typed value of the parameter.
Declaration
public T? TypedValue { get; set; }
Property Value
Type | Description |
---|---|
T |
Value
Gets or sets the value of the parameter. This delegates to TypedValue.
Declaration
public override object? Value { get; set; }
Property Value
Type | Description |
---|---|
object? |
Overrides
Implements
IDbDataParameter
ICloneable