Account.cs
public IList<Alert> Alerts { get; set; }
Alert.cs
public Account Account { get; set; }
Bag<Alert>(x => x.Alerts, c => { }, r => { r.OneToMany(); });
并在警戒方面
AlertMap.cs
ManyToOne(x => x.Account);
有人可以确认此映射是否正确?
答案 0 :(得分:1)
Inverse()
Bag(x => x.Alerts, c => { c.Inverse(); c.Key("account_id"); }, r => { r.OneToMany();
});
ManyToOne(x => x.Account, c => c.Column("account_id"));
注意: