I have a list of objects X
(with the name x
) with properties a
and b
of the same type Location
. I also have a list of locations y
. I need to find all objects in x
for which a
AND b
are contained in the list y
.
I can do it with loops and Where
s but as both lists are huge, I need a really good performing solution. Is there any way to use Intersect
in this case? Or something else?
Here some pseudo code
class X
{
Location a;
Location b;
}
GetMatches(List<X> x, List<Location> y) { ?? }