-
Notifications
You must be signed in to change notification settings - Fork 227
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
42883: operator does not exist: tag_control_type = integer after .net 9 update #3404
Comments
Can confirm. Updating from 8.0.10 to 9.0.2 broke enum mapping & actions with them for me as well. UPD: Same behavior running 9.0.0 |
@Rasmus715 @clintsinger you will need to update the way how you register the mapping |
Thanks for pointing that out. I haven't had to look at the documentation for some time so it caught me off guard. An analyzer would be awesome in this situation to notify people of these kinds of changes. That being said, I have run into another issue. I tried both the "connection string" and "data source" configurations but I'm getting the following error:
I do have the following which may be the reason for the error but I'm not sure:
Where This did work in 8.0 |
The database context and enum mapping are registered the next way:
Results with the same error. |
I have done a bit more experimentation and based on my use case I'm still running into the issue
It seems that whatever is happening under the hood it doesn't like registering two types of db context. Again, this worked fine in 8.0. I should also point out that I did also have a duplicate |
I was able to work past my issue with the two contexts by refactoring my project to only use the After getting past that I ran into another issue
The enum is mapped according to the latest 9.0 guidelines.
I do have other enums that are configured the same way but they aren't throwing the same error. The only thing I can think of that might "different" is that these entities with the The enum fields in question are in a base class. |
Seeing the same thing. We have 2 contexts (migrating data from legacy service) and the enums are registered properly using the latest pattern via the NpgsqlDataSourceBuilder. VersionsMicrosoft.EntityFrameworkCore - 7.0.20 Stack Trace
NoteI've worked around this in a previous project/service where we were using Dapper and I remember having to doing something like:
Once the db value matches the properly cased Enum representation, everything works fine. However, as you can tell from the stack trace, we're using a DbContext and the error is being thrown on the call to |
There seem to be multiple things being reported in this issue. First, enum mapping has indeed changed significantly in 9.0, and user code may need to react. Please carefully read the 9.0 release notes to know more. If you still believe you're hitting a provider bug after reading that, then I need a minimal, runnable repro that shows the problem - please open a new issue, as this one has become somewhat unfocused. Also, there's already #3375 tracking the problem of MapEnum being called multiple times (see #3375 (comment) for the workaround). |
Yes, this thread has evolved and could be split into additional issues. I'll sum up what has occurred.
|
Great, thanks for the breakdown @clintsinger. |
I have updated from .net 8 to .net 9 and all of the packages that come with it but now am running into an issue about an operator not existing.
If I roll back to .net 8 the error goes away so definitely follows the latest .net updates.
Additional logs
The database initialization:
Setting up the data source builder:
And the model builder:
The text was updated successfully, but these errors were encountered: