我对LINQ很新,所以我假设我错过了一些简单的东西。我有一个生成下面的错误代码:局部序列不能在LINQ中使用到SQL简单的LINQ问题:“本地序列无法使用”错误
return (from x in db.CurrentTrackings
where x.strLocation == BarCode ||
(from b in ChildBranches where x.strLocation == b.BarCode select b).Count() > 0 ||
(from c in PlantCustomers where x.strLocation == c.customer_str_id select c).Count() > 0
select x).Count();
请让我知道,如果你需要进一步澄清。这似乎应该工作,但我必须错过一些东西。
这很好用!现在我的麻烦是,我有这么多的数据,而且我不得不多次调用这个查询,所以它真的很慢。 – zmarks22
看看使用编译查询? –