-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[8.0-rc.1] 'dbcontext optimize' does not preserve convertsNulls
#31942
Comments
@schuettecarsten Please try with the latest daily build and if you still see an issue then please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
@ajcvickers I tried latest build (8.0.0-rtm.23503.6) and get the same error. The error seems to be caused by Update: Root cause found. I have a custom
This worked fine in v7 and now fails when creating the model code. I had to remove the |
@ajcvickers I also found that
The generated code is:
The same code is generated if I change the convertsNulls parameter to |
@ajcvickers Is is by design / expected that the code generator creates lots of code that seems to be unneccessary? Here is one example, the following code is generated for every SQL server column. This creates dozends of identical ValueComparer instances, lots of expressions and redundant compiled lambda functions....
For nullable columns, the code is more complex, but also always the same for each column of that type:
The same for SqlServerStringTypeMapping, SqlServerBoolTypeMapping, SqlServerByteArrayTypeMapping, GuidTypeMapping, ... |
/cc @AndriySvyryd |
convertsNulls
Fixes #31942 ### Description Updates to the compiled model resulted in losing the `convertsNulls` state of a value converter. ### Customer impact Silent regression from 7 resulting in different data returned. ### How found Customer reported on daily build. ### Regression Yes. ### Testing Added tests. ### Risk Low.
This looks like the same case as #31859. |
@ajcvickers @AndriySvyryd |
Yes, this is part of our future Native AOT support #29754 |
I upgraded my code from 7.0.11 to 8.0.0-rc.1 just to test compatibility. When creating an pre-compiled model using dotnet tool run dotnet-ef -- dbcontext optimize ...`, I get the following exception. It works when using 7.0.11 libraries.
I use -v option, but as no more details are shown after build completes, I cannot analyze what exactly goes wrong.
The text was updated successfully, but these errors were encountered: