Skip to content

Commit 39dceeb

Browse files
committed
add comment explaining why this change was needed
1 parent 4eaaa2b commit 39dceeb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorDbContext.cs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ protected override void OnModelCreating(ModelBuilder builder)
2727
builder.Entity<Order>()
2828
.HasOne(order => order.Shipment)
2929
.WithOne(shipment => shipment.Order)
30+
// Without specifying "OrderId", the primary key will be used as a foreign key which would result in attempt to update the shipment identity when this relationship is patched.
3031
.HasForeignKey<Shipment>("OrderId")
3132
.IsRequired();
3233
}

0 commit comments

Comments
 (0)