# 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
  object
  MarshalByRefObject
  DbParameter
  NpgsqlParameter
  NpgsqlParameter<T>

Implements
  IDbDataParameter
  IDataParameter
  ICloneable

Inherited Members
  NpgsqlParameter.ParameterName
  NpgsqlParameter.NpgsqlValue
  NpgsqlParameter.DbType
  NpgsqlParameter.NpgsqlDbType
  NpgsqlParameter.DataTypeName
  NpgsqlParameter.IsNullable
  NpgsqlParameter.Direction
  NpgsqlParameter.Precision
  NpgsqlParameter.Scale
  NpgsqlParameter.Size
  NpgsqlParameter.SourceColumn
  NpgsqlParameter.SourceVersion
  NpgsqlParameter.SourceColumnNullMapping
  NpgsqlParameter.Collection
  NpgsqlParameter.PostgresType
  NpgsqlParameter.ResetDbType()
  NpgsqlParameter.Clone()
  MarshalByRefObject.GetLifetimeService()
  MarshalByRefObject.InitializeLifetimeService()
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.ReferenceEquals(object, object)
  object.ToString()

## 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