Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of generic type definitions #128

Closed
CptWesley opened this issue Apr 23, 2024 · 0 comments · Fixed by #129
Closed

Inconsistent handling of generic type definitions #128

CptWesley opened this issue Apr 23, 2024 · 0 comments · Fixed by #129

Comments

@CptWesley
Copy link
Contributor

CptWesley commented Apr 23, 2024

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.

This will most likely also resolve this issue: JasperFx/marten#3148

Will create pull request with proposed solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant