如何在NHibernate中映射时分配多个主键?
Id(x => x.TopicID); <<----Primary Key
Map(x => x.Topic); <<---Should Also be a Primary Key
Map(x => x.Subtitle);
Map(x => x.Description);
Map(x => x.ImageURL);
}
答案 0 :(得分:0)
使用CompositeID方法:
CompositeId()
.KeyProperty(x => x.TopicId, "name")
.KeyReference(x => x.Topic, "anotherName");