0
對於簡單的FK我可以通過使用實體框架代碼第一逆屬性生成列名
[ForeignKey("CustomList1")]
public int? CustomList1ID { get; set; }
public virtual CustomList CustomList1 { get; set; }
但inverseProperty更改生成列名(因爲我有多個customList,如何控制對生成列名數據庫?
[InverseProperty("CustomList1")]
public virtual List<Customer> CustomerCustomList1 { get; set; }
我知道ForeignKey(「CustomList1」)不會更改列名稱,但下一行顯式添加一個FK鍵會得到我需要的名稱。 我也知道專欄(「myname」)將爲簡單的FK做,但對於InverseProperty它似乎不工作。 – neogeo 2012-04-20 17:40:40