0
我有一個名爲預訂EF 6導航同一類型
public class Booking
{
public int ID { get; set; }
public string Name { get; set; }
// some other properties...
}
我需要能夠以兩種不同的預訂鏈接在一起EF DB模式的兩個對象之間的財產,如何創造一個導航屬性,讓我每個預訂之間的鏈接?
E.g,預訂A需要的導航屬性來預訂B和反之亦然,預訂B需要的導航屬性來預訂A.
感謝。
它只是一對一的關係,還是你還需要兩個以上的關聯? – Martin
只有一對一的關係 – Russ
這將有助於http://stackoverflow.com/questions/18398417/entity-framework-code-first-tree-model你只需要一個引用屬性和外鍵 – Martin