Class NpgsqlTypeMapping
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.
Inheritance
Inherited Members
Namespace: Npgsql.TypeMapping
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlTypeMapping
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.
Declaration
public Type[] ClrTypes { get; }
Property Value
Type | Description |
---|---|
System.Type[] |
DbTypes
A set of System.Data.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.
Declaration
public DbType[] DbTypes { get; }
Property Value
Type | Description |
---|---|
System.Data.DbType[] |
InferredDbType
Determines what is returned from DbType when this mapping is used.
Declaration
public DbType? InferredDbType { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Data.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.
Declaration
public NpgsqlDbType? NpgsqlDbType { get; }
Property Value
Type | Description |
---|---|
System.Nullable<NpgsqlDbType> |
PgTypeName
The name of the PostgreSQL type name, as it appears in the pg_type catalog.
Declaration
public string PgTypeName { get; }
Property Value
Type | Description |
---|---|
System.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.
Declaration
public NpgsqlTypeHandlerFactory TypeHandlerFactory { get; }
Property Value
Type | Description |
---|---|
NpgsqlTypeHandlerFactory |
Methods
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |