Skip to content

Commit 320eab6

Browse files
author
Bart Koelman
committed
Updated comment
1 parent 39dceeb commit 320eab6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorDbContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ protected override void OnModelCreating(ModelBuilder builder)
2424
.WithOne(order => order.Customer)
2525
.IsRequired();
2626

27+
// A foreign key is required for 1-to-1, because a Patch Relationship request must not change the identity of a resource.
2728
builder.Entity<Order>()
2829
.HasOne(order => order.Shipment)
2930
.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.
3131
.HasForeignKey<Shipment>("OrderId")
3232
.IsRequired();
3333
}

0 commit comments

Comments
 (0)