Possible duplicate:
Create items from 3 collections using Linq
I performed a zippage of two sequences as follows.
IEnumerable<Wazoo> zipped = arr1.Zip(arr2, (outer, inner) => new Wazoo{P1 = outer, P2 = inner});
Now I realized that I will use three sequences, not two. So I tried redesigning the code like this:
IEnumerable<Wazoo> zipped = arr1.Zip(arr2, arr3, (e1, e2, e3) => new Wazoo{P1 = e1, P2 = e2, P3 = e3});
Of course, this did not work. Is there a way to deploy Zip to include what I'm aiming for? Is there any other way to use this? Should I fasten two of the sequences and then fasten them by third unpacking in the process?
At this point, I'm going to create a simple for -loop and yield return requested structure. Do I need to? I'm on .Net 4.
source share