Table of Contents

Class NpgsqlTypeMapping

Namespace
Npgsql.TypeMapping
Assembly
Npgsql.dll

Represents a type mapping for a PostgreSQL data type, which can be added to a type mapper, managing when that data type will be read and written and how.

public sealed class NpgsqlTypeMapping
Inheritance
NpgsqlTypeMapping
Inherited Members

Properties

ClrTypes

A set of CLR types that correspond to this type. Setting an NpgsqlParameter's Value property to one of these types will make Npgsql write its value to PostgreSQL with this mapping.

public Type[] ClrTypes { get; }

Property Value

Type[]

DbTypes

A set of DbTypes that correspond to this type. Setting an NpgsqlParameter's DbType property to one of these values will make Npgsql write its value to PostgreSQL with this mapping.

public DbType[] DbTypes { get; }

Property Value

DbType[]

InferredDbType

Determines what is returned from DbType when this mapping is used.

public DbType? InferredDbType { get; }

Property Value

DbType?

NpgsqlDbType

The NpgsqlDbType that corresponds to this type. Setting an NpgsqlParameter's NpgsqlDbType property to this value will make Npgsql write its value to PostgreSQL with this mapping.

public NpgsqlDbType? NpgsqlDbType { get; }

Property Value

NpgsqlDbType?

PgTypeName

The name of the PostgreSQL type name, as it appears in the pg_type catalog.

public string PgTypeName { get; }

Property Value

string

Remarks

This can a a partial name (without the schema), or a fully-qualified name (schema.typename) - the latter can be used if you have two types with the same name in different schemas.

TypeHandlerFactory

A factory for a type handler that will be used to read and write values for PostgreSQL type.

public NpgsqlTypeHandlerFactory TypeHandlerFactory { get; }

Property Value

NpgsqlTypeHandlerFactory

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

See Also