Closed Leosori closed 3 years ago
I will see if I can replicate this behavior.
In order to surface a nav-property-isnullable
template item, we need to determine whether a navigation property is optional, where the foreign key is nullable. I looked at INavigation, but I could not find an extension method that would reveal this.
@bricelam, Can you point us in the right direction? [Nevermind, @kevin-a-naude submitted a PR with the fix.]
Describe the bug If EnableNullableReferenceTypes is set to true, non-collection nav properties that belong to a nullable property are not marked as nullable. This causes Entity Framework to use INNER JOINs instead of OUTER JOINs when generating the SQL query.
Example of the currently generated entity:
Expected behavior
Additional context Property template looks currently like this and uses
property-isnullable
Nav properties have this template:
In order to get it right, the nav property template needs access to
property-isnullable
AFAIK should the collection variant stay non-nullable because this is covered by an empty collection.