-
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
EF Core does not cast from Nullable to underlying type #10284
Comments
@maumar Nav expansion? |
looks like it |
By the way with explicit casting it works: |
The problem here is that during nav rewrite we deduce that since Person->ApplicationUser is principal to dependent, ApplicationUser can be null, so we apply null protection logic on the call accessing Status property. This changes the type to |
@maumar So we should unwrap before calling into client method here? cc @smitpatel |
Problem was that we were too aggressive in applying null compensation during navigation rewrite. This could lead to type change of an argument to a function - if the argument was a non-nullable property accessed via optional navigation). This in turn causes issues during compilation, because new method arguments must match method signature. Fix is to unwrap null compensation for arguments of the function.
Problem was that we were too aggressive in applying null compensation during navigation rewrite. This could lead to type change of an argument to a function - if the argument was a non-nullable property accessed via optional navigation). This in turn causes issues during compilation, because new method arguments must match method signature. Fix is to unwrap null compensation for arguments of the function.
Problem was that we were too aggressive in applying null compensation during navigation rewrite. This could lead to type change of an argument to a function - if the argument was a non-nullable property accessed via optional navigation). This in turn causes issues during compilation, because new method arguments must match method signature. Fix is to unwrap null compensation for arguments of the function.
Problem was that we were too aggressive in applying null compensation during navigation rewrite. This could lead to type change of an argument to a function - if the argument was a non-nullable property accessed via optional navigation). This in turn causes issues during compilation, because new method arguments must match method signature. Fix is to unwrap null compensation for arguments of the function.
fixed in f7e93de |
Having the following mapping:
Query fails with exception on this part:
Status property type is enum. Relation beetwen Parent and ApplicationUser:
Further technical details
EF Core version: 2.0.0
Database Provider: Microsoft.EntityFrameworkCore.SQLServer
Operating system: Windows 10 Pro 1703 15063.540
IDE: Visual Studio 2017
The text was updated successfully, but these errors were encountered: