I\'m trying to query data of the form with LINQ-to-EF:
class Location {
string Country;
string City;
string Address;
…
}
by
How about:
var result = locations.Where(l => keys.Any(k =>
k.Country == l.Country &&
k.City == l.City &&
k.Address == l.Address));
UPDATE
Unfortunately EF throws NotSupportedException on that, which disqualifies this answer if you need the query to run on DB side.
UPDATE 2
Tried all kinds of joins using custom classes and Tuples - neither works. What data volumes are we talking about? If it's nothing too big, you could either process it client-side (convenient) or use unions (if not faster, at least less data is transmitted).