IT:AD:EF/CodeFirst:HowTo:Define/Models/Relationships/Examples/1-0..1
Process
Process
//////1-0..1:
modelBuilder.Entity<Invoice>()
//The property is called Shipping Address, but is backed
//by an Address entity
.HasRequired(i => i.ShippingAddress)
.WithMany()
//As the address is probably a reference to the
//User's 'home' address, we turn off cascade delete.
.WillCascadeOnDelete(false);
//As the Address table is shared between different
//entities, we can't put on it a UserFK or InvoiceFK
//or means to navigate back to the owner table.
//so avoid .WithRequired()