EntityFrameworkについて質問があります。コードファーストのシナリオでは、住所を参照する人物クラスがあります。私のドメインでは、これをAddressクラスへの参照として使用します。私が見たEntityFrameworkのすべての例には、AddressIdフィールドも必要です。これは私がそこにあるべきではないと思うものであり、私のドメイン駆動モデルでは必要ありません。
EFがこれを必要とするのはなぜですか?それなしでできますか(NHibernateがこれを必要とするとは思わない)。
ありがとう
public class Person()
{
public int Id {get;set;}
public string Name {get;set;}
public Address Address {get;set;}
public int AddressId {get;set;} //Entity Framework seems to require this
}