Often a one-to-one relationship is required. Mapping these in EF is very similar to mapping any other relationships. For this example each person can have one car, and each car must belong to one and only one person.
This doesn’t work. The generated migration wants CarId to be a foreign key.
If we update the mapping to include a key name, we get the correct result. A column named PersonId is created even though it is not specified in our model.
An alternative approach to this is to use PersonId as the primary key on the cars table. This more than likely will not make much sense in your business domain, but it is possible.