Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
小于或等于int值的linq联接_Linq_Entity Framework_Linq To Entities_Where - Fatal编程技术网

小于或等于int值的linq联接

小于或等于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

我想知道对于小于或等于where子句的最佳方法,其中要匹配的值是int

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();

您对所得到的查询有什么顾虑?这比原始查询糟糕得多