You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
An unidirectional association from Entity1 to Entity2 where End 1 is many and End 2 is one should have the required attribute set / configured for the navigation property on Entity1 to Entity2. See the following simple diagram:
With the current extension version 1.3.0.12 and EF Core this is missing, neither the Required attribute on the property nor the fluent IsRequired for the foreign key gets generated. Interestingly, "Required" is inserted into the summary comment of the navigation property.
By the way: Awesome tool! Really makes working with EF (Core in my instance) so much more pleasant.
The text was updated successfully, but these errors were encountered:
msawczyn
added
bug
Confirmed bug
pending release
Issue is resolved in the current codebase, will be published with the next release
and removed
pending release
Issue is resolved in the current codebase, will be published with the next release
labels
Feb 17, 2020
There really aren't any foreign keys in this mix since we're letting EF create shadow properties for those (as it should be! :-) ), but the cardinality of the navigation properties is clearly messed up. This has additional repercussions as, since the T4 doesn't see the navigation property as required, it's not creating proper constructors and we get two default constructors generated for Entity1. I can't imagine how this hasn't been caught previously, so I'm guessing this must be a recent regression. We'll need to get a patch in asap.
Regarding the constructors, the generated code seems to be correct as far as I can tell: there is a protected default one for EF and the public one requiring an instance of Entity2, so it might not be messed up completely after all.
msawczyn
added
released
Issue is resolved in a current release
and removed
pending release
Issue is resolved in the current codebase, will be published with the next release
labels
Apr 11, 2020
An unidirectional association from
Entity1
toEntity2
where End 1 is many and End 2 is one should have the required attribute set / configured for the navigation property onEntity1
toEntity2
. See the following simple diagram:With the current extension version 1.3.0.12 and EF Core this is missing, neither the
Required
attribute on the property nor the fluentIsRequired
for the foreign key gets generated. Interestingly, "Required" is inserted into the summary comment of the navigation property.By the way: Awesome tool! Really makes working with EF (Core in my instance) so much more pleasant.
The text was updated successfully, but these errors were encountered: