Reputation: 161
HI
I have 2 lists, list 1 contains objects and list 2 contains strings, i am trying to filter objects whose name are in the list 2 using following ling query but it doesn't work. Object has a Name property.
var query =
from item1 in List1
let current = item1.Name
let exclude = from item2 in exceptionList select item2
where current != exclude.ToString()
select item1;
Thanks
Upvotes: 0
Views: 92
Reputation: 5224
why dont you just do...
from item1 in List1
where List2.Contains(item1.Name)
select item1
Upvotes: 1