如果我这样做,我有一个正确的linq语句
Dim mList = From w In oS
Where w.Active = True
Select w
Dim mlist2 = From w In mList
Where w.EmployeeID <> 19
Select w
Dim mlist3 = From w In mlist2
Where w.EmployeeID <> 20
Select w
我想将它们合并为一个陈述但却无法解决问题。这不起作用,它会过滤掉w.Active = true
,但19和20的EmployeeID
不会被过滤掉。
Dim mList = From w In oS
Where w.Active = True AndAlso (w.EmployeeID <> 19 Or w.EmployeeID <> 20)
Select w
答案 0 :(得分:0)
您需要为每个语句添加位置原因。
Dim mList =来自w In OS 其中w.Active = True AndAlso(w.EmployeeID <> 19或w.EmployeeID <> 20) 选择w