Currenlty the implementation of GetDatabaseType and ToParameterType treat types with generics in different ways:
GetDatabaseType always strips the concrete generic arguments to retrieve the generic type definition and uses that to try and retrieve the registered type name.
ToParameterType does not have special handling.
I would expect these two functions to treat generic types in the same way (otherwise it is always required to add 1 concrete and 1 open version to e.g. the NpgsqlTypeMapping implementation).
My proposal would be to first attempt to find a mapping for the type directly, if there is no such definition, retry on the open generic version of it.
Currenlty the implementation of
GetDatabaseType
andToParameterType
treat types with generics in different ways:GetDatabaseType
always strips the concrete generic arguments to retrieve the generic type definition and uses that to try and retrieve the registered type name.ToParameterType
does not have special handling.I would expect these two functions to treat generic types in the same way (otherwise it is always required to add 1 concrete and 1 open version to e.g. the
NpgsqlTypeMapping
implementation).My proposal would be to first attempt to find a mapping for the type directly, if there is no such definition, retry on the open generic version of it.
This will most likely also resolve this issue: https://github.com/JasperFx/marten/issues/3148
Will create pull request with proposed solution