As a nullable string gives a different result than null

In general, the picture says it all. I have a string that is null and I cannot get my user with it. However, if I type null, it works.

Weirdest error

I made this workaround that works, but I don't see how it is needed enter image description here

I saw something about null primitives and EF 6 (I use EF6), but this is a string.

Does anyone know why?


Update

As you can see here, I use. UseCSharpNullComparisonBehavior = true; Now I have tried both on Azure and SQL Express.

It is incredible that this works on a living system, we did some development, but nothing, as far as I know, should affect this.

I also updated to the latest version of EF from nuget.

enter image description here

+4
1

:

?

, Entity Framework - SQL. null, , EF IS NULL SQL

EDIT:

EF 6, , , , , :

objectContext.ContextOptions.UseCSharpNullComparisonBehavior = true;
+6

All Articles