Search Results for

    Show / Hide Table of Contents

    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
    Object
    NpgsqlTypeMapping
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    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
    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.

    Declaration
    public DbType[] DbTypes { get; }
    Property Value
    Type Description
    DbType[]

    InferredDbType

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

    Declaration
    public DbType? InferredDbType { get; }
    Property Value
    Type Description
    Nullable<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
    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
    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
    String
    Overrides
    Object.ToString()

    See Also

    GlobalTypeMapper
    TypeMapper
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team