# Class NpgsqlTypeMapping

Namespace
  Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

The base class for mapping Npgsql-specific types. It configures parameters with the NpgsqlDbType provider-specific type enum.

    public abstract class NpgsqlTypeMapping : RelationalTypeMapping, INpgsqlTypeMapping

Inheritance
  object
  CoreTypeMapping
  RelationalTypeMapping
  NpgsqlTypeMapping

Implements
  INpgsqlTypeMapping

Derived
  DateIntervalMultirangeMapping
  DateIntervalRangeMapping
  DateMapping
  DurationIntervalMapping
  IntervalMultirangeMapping
  IntervalRangeMapping
  LegacyTimestampInstantMapping
  NpgsqlBigIntegerTypeMapping
  NpgsqlBitTypeMapping
  NpgsqlBoxTypeMapping
  NpgsqlCidrTypeMapping
  NpgsqlCircleTypeMapping
  NpgsqlDateOnlyTypeMapping
  NpgsqlDateTimeDateTypeMapping
  NpgsqlDecimalTypeMapping
  NpgsqlHstoreTypeMapping
  NpgsqlInetTypeMapping
  NpgsqlIntervalTypeMapping
  NpgsqlJsonTypeMapping
  NpgsqlLineSegmentTypeMapping
  NpgsqlLineTypeMapping
  NpgsqlMacaddr8TypeMapping
  NpgsqlMacaddrTypeMapping
  NpgsqlPathTypeMapping
  NpgsqlPgLsnTypeMapping
  NpgsqlPointTypeMapping
  NpgsqlPolygonTypeMapping
  NpgsqlRangeTypeMapping
  NpgsqlRegconfigTypeMapping
  NpgsqlRegdictionaryTypeMapping
  NpgsqlTidTypeMapping
  NpgsqlTimeTypeMapping
  NpgsqlTimeTzTypeMapping
  NpgsqlTimestampTypeMapping
  NpgsqlTimestampTzTypeMapping
  NpgsqlTsQueryTypeMapping
  NpgsqlTsVectorTypeMapping
  NpgsqlUIntTypeMapping
  NpgsqlULongTypeMapping
  NpgsqlVarbitTypeMapping
  PeriodIntervalMapping
  TimeMapping
  TimeTzMapping
  TimestampLocalDateTimeMapping
  TimestampTzInstantMapping
  TimestampTzOffsetDateTimeMapping
  TimestampTzZonedDateTimeMapping

Inherited Members
  RelationalTypeMapping.NullMapping
  RelationalTypeMapping.Clone(CoreTypeMapping.CoreTypeMappingParameters)
  RelationalTypeMapping.Clone(RelationalTypeMapping.RelationalTypeMappingParameters)
  RelationalTypeMapping.WithStoreTypeAndSize(string, int?)
  RelationalTypeMapping.WithPrecisionAndScale(int?, int?)
  RelationalTypeMapping.WithComposedConverter(ValueConverter, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter)
  RelationalTypeMapping.WithTypeMappingInfo(in RelationalTypeMappingInfo)
  RelationalTypeMapping.Clone(in RelationalTypeMappingInfo?, Type, ValueConverter, ValueComparer, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter, StoreTypePostfix?)
  RelationalTypeMapping.ProcessStoreType(RelationalTypeMapping.RelationalTypeMappingParameters, string, string)
  RelationalTypeMapping.CreateParameter(DbCommand, string, object, bool?, ParameterDirection)
  RelationalTypeMapping.GenerateSqlLiteral(object)
  RelationalTypeMapping.GenerateProviderValueSqlLiteral(object)
  RelationalTypeMapping.GenerateNonNullSqlLiteral(object)
  RelationalTypeMapping.GetDataReaderMethod()
  RelationalTypeMapping.GetDataReaderMethod(Type)
  RelationalTypeMapping.CustomizeDataReaderExpression(Expression)
  RelationalTypeMapping.Parameters
  RelationalTypeMapping.StoreTypePostfix
  RelationalTypeMapping.StoreType
  RelationalTypeMapping.StoreTypeNameBase
  RelationalTypeMapping.DbType
  RelationalTypeMapping.IsUnicode
  RelationalTypeMapping.Size
  RelationalTypeMapping.Precision
  RelationalTypeMapping.Scale
  RelationalTypeMapping.IsFixedLength
  RelationalTypeMapping.SqlLiteralFormatString
  CoreTypeMapping.Clone(in TypeMappingInfo?, Type, ValueConverter, ValueComparer, ValueComparer, ValueComparer, CoreTypeMapping, JsonValueReaderWriter)
  CoreTypeMapping.GenerateCodeLiteral(object)
  CoreTypeMapping.ClrType
  CoreTypeMapping.Converter
  CoreTypeMapping.ValueGeneratorFactory
  CoreTypeMapping.Comparer
  CoreTypeMapping.KeyComparer
  CoreTypeMapping.ProviderValueComparer
  CoreTypeMapping.ElementTypeMapping
  CoreTypeMapping.JsonValueReaderWriter
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### NpgsqlTypeMapping(RelationalTypeMappingParameters, NpgsqlDbType)

Constructs an instance of the NpgsqlTypeMapping class.

    protected NpgsqlTypeMapping(RelationalTypeMapping.RelationalTypeMappingParameters parameters, NpgsqlDbType npgsqlDbType)

#### Parameters

`parameters` RelationalTypeMapping.RelationalTypeMappingParameters

  The parameters for this mapping.

`npgsqlDbType` NpgsqlDbType

  The database type of the range subtype.

### NpgsqlTypeMapping(string, Type, NpgsqlDbType, JsonValueReaderWriter?)

Constructs an instance of the NpgsqlTypeMapping class.

    public NpgsqlTypeMapping(string storeType, Type clrType, NpgsqlDbType npgsqlDbType, JsonValueReaderWriter? jsonValueReaderWriter = null)

#### Parameters

`storeType` string

  The database type to map.

`clrType` Type

  The CLR type to map.

`npgsqlDbType` NpgsqlDbType

  The database type used by Npgsql.

`jsonValueReaderWriter` JsonValueReaderWriter

  Handles reading and writing JSON values for instances of the mapped type.

## Properties

### NpgsqlDbType

The database type used by Npgsql.

    public virtual NpgsqlDbType NpgsqlDbType { get; }

#### Property Value

NpgsqlDbType

## Methods

### ConfigureParameter(DbParameter)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

    protected override void ConfigureParameter(DbParameter parameter)

#### Parameters

`parameter` DbParameter

### GenerateEmbeddedNonNullSqlLiteral(object)

Generates the SQL representation of a non-null literal value, meant to be embedded in another literal value, e.g. in a range.

    protected virtual string GenerateEmbeddedNonNullSqlLiteral(object value)

#### Parameters

`value` object

  The literal value.

#### Returns

string

  The generated string.

### GenerateEmbeddedProviderValueSqlLiteral(object?)

Generates the SQL representation of a literal value without conversion, meant to be embedded in another literal value, e.g. in a range.

    public virtual string GenerateEmbeddedProviderValueSqlLiteral(object? value)

#### Parameters

`value` object

  The literal value.

#### Returns

string

  The generated string.

### GenerateEmbeddedSqlLiteral(object?)

Generates the SQL representation of a literal value meant to be embedded in another literal value, e.g. in a range.

    public virtual string GenerateEmbeddedSqlLiteral(object? value)

#### Parameters

`value` object

  The literal value.

#### Returns

string

  The generated string.