Skip to content

Commit 8a68a7a

Browse files
author
Bart Koelman
committed
ff
1 parent 451bb32 commit 8a68a7a

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
// By default, EF Core generates an identifying foreign key for a required 1-to-1 relationship.
2828
// This means no foreign key column is generated, instead the primary keys point to each other directly.
2929
// That mechanism does not make sense for JSON:API, because patching a relationship would result in
30-
// also changing the identity of a resource. Therefore we need to add an explicit foreign in this case.
30+
// also changing the identity of a resource. Naming the key explicitly forces to create a foreign key column.
3131
builder.Entity<Order>()
3232
.HasOne(order => order.Shipment)
3333
.WithOne(shipment => shipment.Order)

0 commit comments

Comments
 (0)