How to map it? HasOne x References

后端 未结 2 1502
情话喂你
情话喂你 2021-01-28 16:01

I need to make a mapping One by One, and I have some doubts. I have this classes:

public class DocumentType {    
    public virtual int Id { get; set; }    
            


        
2条回答
  •  执笔经年
    2021-01-28 16:26

    If the relationship is really one-to-one... then use HasOne :-)

    See http://nhibernate.info/doc/nhibernate-reference/mapping.html#mapping-declaration-onetoone. It has all you need to know.

提交回复
热议问题