Entity Framework 5.0 composite foreign key to non primary key - is it possible?
问题 I am using Entity Framework 5.0.0.0 in a .net 4.5 console application and I have to access a database with two tables in it with a foreign key relationship between them like so: The odd thing about it is that the foreign key is between B(Almost1, Almost2) and A(Almost1, Almost2) not from B(AId) to A(AId) . This is allowed by SQL server as Almost1 and Almost2 combined are unique and neither are nullable (on table A at least - on B they are as it is an optional relationship but that is by the