-
Notifications
You must be signed in to change notification settings - Fork 215
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
Support advanced type mappings in the compiled model #2949
Comments
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Nov 17, 2023
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Nov 17, 2023
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Nov 17, 2023
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Nov 17, 2023
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Nov 18, 2023
roji
added a commit
that referenced
this issue
Nov 18, 2023
This was referenced Feb 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starting with 8.0, type mapping must have a static Default property in order to be supported in the compiled model; the generated code starts with these properties, and clones them to overwrite all the different info in RelationalTypeMappingParameters if necessary (store type, CLR type, etc. etc.).
Most type mappings were made compatible with this scheme in #2948. However, one problematic case is when a type mapping has state that isn't contained within RelationalTypeMappingParameters; since the default value can't get overwritten via the standard Clone (with accepts a RelationalTypeMappingParameters), we must customize the C# code generation in RelationalCSharpRuntimeAnnotationCodeGenerator.Create (for type mappings), adding an additional cloning to apply those custom state data.
Type mappings that require this are:
NpgsqlStringTypeMapping (varchar, xml, citext, ltree as string, lquery, ltxtqueryNpgsqlULongTypeMapping (xid8)NpgsqlRangeTypeMapping/cc @AndriySvyryd
The text was updated successfully, but these errors were encountered: