How do I setup a foreign key relationship in codefirst without using a navigation property?
问题 Say you have an order class with an order status, I want to declare the OrderStatusId inside the OrderStatus class. However, no foreign key relationship is set-up by default. If I use [ForeignKey] attribute on the column it seems to demand a navigation property which I don't want as this would mean having to carry out joins on the navigation property in all of my queries just to check the status. How do I accomplish this in EF codefirst? Define a property as a foreign key without using a