- 基于共享主键的一对一:
this.HasRequired(t => t.TRDConInfo)
.WithOptional(t => t.TRDFoundationProjCheck); - 一对多
this.HasRequired(t => t.ComponentBelong)
.WithMany(t => t.TRDConInfos)
.HasForeignKey(d => d.ComponentBelongID); - 多对多
this.HasMany(t => t.Contract)
.WithMany(t => t.DesignChangeAudit)
.Map(m => {
m.ToTable("T_Change_DesignAudit_Contract");
m.MapLeftKey("DesignChangeAuditID");
m.MapRightKey("ContractID");
});
时间: 2024-09-30 17:26:33