46
什麼是真正的區別是:映射鍵VS HasForeignKey差異 - 流暢API
this.HasRequired(a => a.Something)
.WithMany()
.Map(a => a.MapKey("SomethingId"));
和
this.HasRequired(a => a.Something)
.WithMany()
.HasForeignKey(a => a.SomethingId);
「很多人認爲的對象 - 關係映射工具是假設解決對象關係的阻抗失配,而不是強迫,甚至鼓勵你讓你的對象模型看起來就像是d專門針對數據如何持續存在「。在那裏,我爲你修好了。 – 2017-03-24 22:29:10