MappingField和Where组合使用的问题。 返回
SqlSugar
沟通中
2
377
悬赏:0 飞吻
Db.Queryable<WarehouseIn>() .Includes(o => o.WarehouseInDetail, x => x.CompanyProduct, y => y.Images.MappingField(img => img.CompanyID, () => y.CompanyID) .Where(img => img.CompanyID == null || img.CompanyID == y.CompanyID) .ToList())
上面这个写法。img.CompanyID == null 的条件不会生效
热忱回答(2)
-
fate sta VIP0
2026/3/11.Where(img => img.CompanyID ==null|| img.CompanyID == y.CompanyID) 这个条件是错的吧。 where只能当前表作为条件0 回复 -
fate sta VIP0
2026/3/11并且mappingfiled只能关系映射。
0 回复