Steve Green set me on the right track, I added
ProductId and
VehicleId to Entity and used
HasRequired(b => b.Vehicle) .WithMany() .HasForeignKey(b => new {b.ProductId, b.VehicleId});
In the domain perspective, I don't like adding foreign keys to an object, so if someone has a better solution, let me know.
source share