I have the folling model in my project (EF5, DBContext, database first):
Customer
InvoiceAddress -> Addresses (table)
DeliveryAddress -> Addresses (table)
So I'm having 2 foreign keys to the same table.
When I load the customer entity using the following statement:
var cst = ctx.Customers.Where(c => c.CustomerID == 2).SingleOrDefault();
ctx.Entry(cst).Reference(c => c.InvoiceAddress).Load();
After the reference of the InvoiceAddress is loaded, the DeliveryAddress is also loaded. However this only happends when the invoice and delivery ID are the same. When they are not equal, the DeliveryAddress is not loaded. What is causing this behavior?