我需要做一個映射,我有一些疑惑。我有這個類:如何映射它? HasOne x參考
public class DocumentType {
public virtual int Id { get; set; }
/* othes properties for documenttype */
public virtual DocumentConfiguration Configuration { get; set; }
public DocumentType() { }
}
public class DocumentConfiguration {
public virtual int Id { get; set; }
/* some other properties for configuration */
public virtual DocumentType Type { get; set; }
public DocumentConfiguration() { }
}
爲DocumentType對象只有一個DocumentConfiguration,但它不是一個繼承,這只是一個獨特的一個,以單獨的屬性。
這種情況下我的映射應該如何?我應該使用References還是HasOne?有人可以舉個例子嗎?
當我加載一個DocumentType對象時,我想自動加載屬性Configuration(在documentType中)。
非常感謝你們!
乾杯
http://jagregory.com/writings/i-think-you-mean-a-many-to-one-sir/ – Steves 2010-05-06 19:02:16