Skip to content

Commit 5eae4e2

Browse files
maureiBart Koelman
authored and
Bart Koelman
committed
Specified a FK in scenario of a required one-to-one relationship. Note that not specifying it results in EF Core configuring this relationship using an identifying FK on the dependent side (Shipment), which is a type of modeling that does not make sense in the scope of JSON:API.
1 parent d585893 commit 5eae4e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorDbContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override void OnModelCreating(ModelBuilder builder)
2727
builder.Entity<Order>()
2828
.HasOne(order => order.Shipment)
2929
.WithOne(shipment => shipment.Order)
30-
.HasForeignKey<Shipment>()
30+
.HasForeignKey<Shipment>("OrderId")
3131
.IsRequired();
3232
}
3333
}

0 commit comments

Comments
 (0)