In EF v1, it is possible to have one way navigations where you have an association between two entities but a navigation in only one of them. But the designer didn’t support this. If you deleted a navigation, the association was automatically removed.
You could, however, go into the XML and remove the navigation property manually, leaving the association, association mappings and the partner navigation property in tact.
The new designer now supports one way relationships – both for models with foreign keys and models without foreign keys.
Here is a model that does not use foreign keys. The associations, by the way, are called “independent associations” when there is no foreign key involved.
I start with a Customers property in the CustomerType entity and a CustomerType property in the Customer entity.
Delete CustomerType.Customers and association and Customer.CustomerType property are still there.
Next, I delete the CustomerType.Customer navigation property but the association/relationship still remains in tact. The navigations are no longer exposed in the classes but you the model is still valid as are the generated classes (I’m using the default code gen).
If you want the association to be gone, you have to explicitly delete it. But for this case, you could just delete the association to begin with and the navigations will automatically be removed. That is the same behavior as in EFv1.
Although the screenshots are from a model with independent associations, the behavior is the same for foreign key associations.
Why the “no-way” association? Either there is some unknown-to-me value to having the association defined in the metadata, or it is the only way the designer is able to pull off keeping the association intact as a result of removing a navigation.
I have asked about this last bit and will share what I learn.
In the meantime, now that it is more discoverable and simpler to create one way relationships, I bet more people will take advantage of it.
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!