我正在使用此代碼創(chuàng)建外鍵:Create.ForeignKey("FK_Table1_Table2") .FromTable("Table1").ForeignColumn("Table1_ID") .ToTable("Table2").PrimaryColumn("Table2_ID");結(jié)果我有一對(duì)多的關(guān)系:public class Table1{ public int Table1_ID { get; set; } public virtual Table2 Table2 { get; set; }}public class Table2{ public Table2() { this.Tables1 = new HashSet<Table1>(); } public int Table2_ID { get; set; } public virtual ICollection<Table1> Tables1 { get; set; }}但我想看看:public class Table2{ public int Table2_ID { get; set; } public virtual Table1 Table1 { get; set; }}有沒有辦法使用 FluentMigrator 做到這一點(diǎn)?
如何使用 FluentMigrator 創(chuàng)建一對(duì)一的外鍵
慕標(biāo)琳琳
2022-12-24 12:22:34