# Interface IDbTypeResolver

Namespace
  Npgsql.Internal

Assembly
  Npgsql.dll

An Npgsql resolver for DbType. Used by Npgsql to resolve a DbType to DataTypeName and back.

    [Experimental("NPG9003")]
    public interface IDbTypeResolver

## Methods

### GetDataTypeName(DbType, Type?)

Attempts to resolve a DbType to a data type name.

    string? GetDataTypeName(DbType dbType, Type? type)

#### Parameters

`dbType` DbType

  The DbType name to resolve.

`type` Type

  The type of the value to resolve a data type name for.

#### Returns

string

  The data type name if it could be mapped, the name can be non-normalized and without schema.

### GetDbType(DataTypeName)

Attempts to resolve a data type name to a DbType.

    DbType? GetDbType(DataTypeName dataTypeName)

#### Parameters

`dataTypeName` DataTypeName

  The data type name to map, in a normalized form but possibly without schema.

#### Returns

DbType?

  The DbType if it could be mapped, null otherwise.