Valeriy (1) [Avatar] Offline
#1
2.1.1, figure 2.1.
A better way to imlement 1-to-1 relationship is to remove PriceOfferId column from the table PriceOffers, remove unique index for BookId column and make BookId a primary key in addition to foreign key (this will add a unique constraint).
As a result, the table PriceOffers will have 1 column less and 1 unique index less.
Jon P Smith (33) [Avatar] Offline
#2
Hi Valeriy,

You are right, and that is exactly what I did at the start as its must more efficent, but it turn out there is a subtle bug in EF Core (see https://github.com/aspnet/EntityFramework/issues/7340). I mention it on page 185 in figure 7.5, and on the top of page 187. The issue may be looked at in the version 2 release.

PS. Hope you are finding the book useful.