I have a scenario where I get some data from two sources (over the web). The data comes in chunks and are continuously arriving until I end my program.
The data from the two sources are stored in two List<T>
's. T
is different for the two lists.
I then Join
the two lists on some parameter into a third type, and after joining then, I would like to look in each lists for data that was not possible to join.
The sequence is:
- Accumulate data in lists
- Join lists
- Clear lists
- Put unjoinable data in lists
- Repeat
So far I have a pretty nice linq query centered around a Join
, and it works nicely.
But when I come to checking if the two lists contain data that was not able to be joined, I have a linq query which essentially iterates through all three lists looking. This is a bit silly and kind of slow, so I was wondering if there is a nice way of joining data in linq while also creating a list of unjoinable data from the two lists.