Interface IDbTypeResolver
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
dbTypeDbTypeThe DbType name to resolve.
typeTypeThe 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
dataTypeNameDataTypeNameThe data type name to map, in a normalized form but possibly without schema.
Returns
- DbType?
The DbType if it could be mapped, null otherwise.