小于或等于int值的linq联接
我想知道对于小于或等于where子句的最佳方法,其中要匹配的值是int小于或等于int值的linq联接,linq,entity-framework,linq-to-entities,where,Linq,Entity Framework,Linq To Entities,Where,我想知道对于小于或等于where子句的最佳方法,其中要匹配的值是int var outOfStockProducts = (from theMapProd in context.tblProductOptions_MAP join theProd in context.tblProducts on theMapProd.productID equals theProd.productID wh
var outOfStockProducts = (from theMapProd in context.tblProductOptions_MAP
join theProd in context.tblProducts on theMapProd.productID equals theProd.productID
where theProd.stock_Level <= 5
select theMapProd).ToList();
var outOfStockProducts=(来自context.tblProductOptions\u映射中的方法)
将杆连接到approd.productID上的context.tblProducts中等于杆.productID
当棒料水平时,这是另一种方式,
没有测试
var outOfStockProducts = (from theMapProd in context.tblProductOptions_MAP
join theProd in context.tblProducts on theMapProd.productID equals theProd.productID
select theMapProd).ToList();
outOfStockProducts=outOfStockProducts.where(x=>x.stock_Level < 5 || x.stock_Level ==5).ToList();
var outOfStockProducts=(来自context.tblProductOptions\u映射中的方法)
将杆连接到approd.productID上的context.tblProducts中等于杆.productID
选择mmapp.ToList();
outOfStockProducts=outOfStockProducts.其中(x=>x.stock_Level<5 | | x.stock_Level==5).ToList();
您对所得到的查询有什么顾虑?这比原始查询糟糕得多