-
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
NullReferenceException when using a filter with conditional function "IIF" #15204
Comments
You don't need to do null safety. They are navigations in EF model. EF will automatically add null safety. |
The query source is really OData: And you are correct the null check an be configured out using |
@BlaiseD I'm having trouble reproducing this error, I'm seeing an error from the expression using the info provided above Do you think you could provide a working standalone test that contains a single test that demonstrates the IIF null ref?
|
Done. |
Thanks I'm still seeing the same exception with your repro, I'm going to reassign this back to @smitpatel to dig deeper in case this is product issue
|
I get the following from Test Explorer running the unit test here running VS 2019 v 16.1.2:
|
@BlaiseD are you trying this in master (against EF 3.0) or 2.2? I am trying your unit test in master |
2.2. If you download or clone the repo here build and run the test you should get the same result. |
@HaoK - Can you try again SQLServer or Sqlite? Include does not work for In-Memory provider, that is the exception you are hitting. |
@smitpatel updating to SqlLite results in a different error:
|
Thanks @HaoK - Bug seems to be still present but in different form. |
System.NullReferenceException gets thrown when executing the query. The query works with EF6.
Steps to reproduce
Execute the following test:
DbContext, classes, and initialization code
Further technical details
EF Core version: Microsoft.EntityFrameworkCore.InMemory v2.2.3
Operating system: Windows 10
IDE: (e.g. Visual Studio 2017 15.9.7)
Thanks.
The text was updated successfully, but these errors were encountered: