JasperFx / weasel

Database Development Made Easy for .Net
MIT License
65 stars 19 forks source link

Inconsistent handling of generic type definitions #128

Closed CptWesley closed 2 months ago

CptWesley commented 2 months ago

Currenlty the implementation of GetDatabaseType and ToParameterType treat types with generics in different ways:

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