FreeSql
FreeSql copied to clipboard
【建议】导航属性增加自定义过滤条件
建议:
- ManyToOne和OneToMany导航增加自定义过滤条件,
- 同步更新[https://freesql.net/guide/]的文档至当前版本且备注不同版本差异,因为文档中很多细节都介绍不完整,对于新手学习曲线比较陡峭
ManyToOne:
.LeftJoin(a => a.Parent.Id == a.ParentId && a.Parent.xxx > 0)
OneToMany:
.IncludeMany(a => a.Children, then => then.Where(child => child.xxx > 0))
在仓储模式中 使用导航属性在curd时可以自动完成关联对象的相同操作,使用LeftJoin或者IncludeMany还需要手动操作关联对象
ManyToOne:
.LeftJoin(a => a.Parent.Id == a.ParentId && a.Parent.xxx > 0)
OneToMany:
.IncludeMany(a => a.Children, then => then.Where(child => child.xxx > 0))
可以在Navigate里设置多个列的导航条件吗
@Gn3po4g 可以,用逗号分割,和对方的主键对应