public class Parent
{
public virtual field1 { get; set;}
public virtual field2 { get; set;}
public virtual Child { get; set;
}
public class Child
{
public virtual childfield1 { get; set;} //composite primary key
public virtual childfield2 { get; set;} //composite primary key
public string somedescription { get; set;}
}
如果我必须只在一个字段上进行映射,我可以在父映射类中完成以下操作:
References(x => x.Child).ForeignKey("field1");
如果连接必须在两个键 field1 和 field2 上,我该怎么做?