I have two queries that produce the same output. One is using the Intersect extension method, the other is a cross join.
There are other ways of also doing the same thing such as a cross join or a normal join, so what else can Intersect be used for?
int[] intsA = new[] {1,4,7,0,3};
int[] intsB = new[] {2,3,8,9,1};
intsA.Intersect(intsB)
(from a in intsA
from b in intsB
where a == b
select a)
Output
IEnumerable (2 items)
1, 3
IEnumerable (2 items)
1, 3