I have two data sources and want to iterate through the first, filtering on the existence of a field in the other data source, as shown in the pseudocode below:
DataContext1 db1 = new DataContext1();
DataContext2 db2 = new DataContext2();
foreach(Address address in db1.Addresses.Where(l => l.LocationCode in db2.AddressList.Select(c => c.LocationCode)))
{
// perform operations
}
如何做到这一点?