I am trying to use CompositeId to map to a legacy system. The source database has a composite primary key so I can t use the normal this.Id mapping.
这里,我试图把它描绘成:
public PriorityListPartMap()
{
this.Schema("EngSchedule");
this.Table("vPriorityListPart");
this.CompositeId().KeyProperty(x => x.AssemblyPartNumber).KeyProperty(x => x.PartNumber);
this.Map(x => x.CurrentDueDate);
this.Map(x => x.OrderLine);
this.Map(x => x.OrderNumber);
this.Map(x => x.PartDescription);
this.Map(x => x.ProductCode);
this.Map(x => x.Revision);
}
When I try to create the session factory this mapping causes the error: Could not compile the mapping document: (XmlDocument)
I tried removing the CompositeId mapping and replaced it with:
this.Id(x => x.AssemblyPartNumber).GeneratedBy.Assigned();
这一错误与这种绘图相去甚远,但我可以实际利用,因为大会党并非独一无二。
是否有不同的办法绘制一个具有综合主要钥匙的表格?
Thanks,
Matthew MacFarland