If I have an IEnumerable where ClassA exposes an ID property of type long. Is it possible to use a Linq query to get all instances of ClassA with ID belonging to a second IE
Naming things is important. Here is an extension method base on the Join operator:
private static IEnumerable IntersectBy(
this IEnumerable source,
IEnumerable keys,
Func keySelector)
=> source.Join(keys, keySelector, id => id, (o, id) => o);
You can use it like this var result = items.IntersectBy(ids, item => item.id).