You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// By default, EF Core generates an identifying foreign key for a required 1-to-1 relationship.
28
+
// This means no foreign key column is generated, instead the primary keys point to each other directly.
29
+
// 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.
27
31
builder.Entity<Order>()
28
32
.HasOne(order =>order.Shipment)
29
33
.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.
0 commit comments