-
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
Model configuration: Shadow primary key should behave the same as non-shadow primary key #7377
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Comments
@hey-red Yes, but it looks like currently you have to be more explicit about the relationship: modelBuilder.Entity<A>()
.HasOne(e => e.Data)
.WithMany()
.HasPrincipalKey("Id"); |
@ajcvickers // map b
modelBuilder.Entity<B>()
.Property<int>("Id");
// map a
modelBuilder.Entity<A>()
.HasOne(e => e.Data)
.WithOne()
.HasForeignKey<B>("AId")
.IsRequired(); Also, maybe has another way to achieve shadow a principal key and foreign key in map b? |
Re-opening as the original case threw an exception, which was not the behavior I expected. |
AndriySvyryd
added a commit
that referenced
this issue
Feb 4, 2017
Rediscover primary key if the matched property is ignored. Fixes #7377
AndriySvyryd
added a commit
that referenced
this issue
Feb 6, 2017
Rediscover primary key if the matched property is ignored. Fixes #7377
AndriySvyryd
added a commit
that referenced
this issue
Feb 6, 2017
Rediscover primary key if the matched property is ignored. Fixes #7377
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Its possible to use "Single Navigation Property" with shadow primary key?
i.e:
The text was updated successfully, but these errors were encountered: