I would like to be able to join these two lists and return the following pairings using LINQ.
The first occurrence of Test1 joins with first occurrence of Test2, then so on.
{ part = 1 , job = "A"}, { part = 1, job = "D" }
{ part = 1 , job = "B"}, { part = 1, job = "E" }
{ part = 1, job = "C" }, { part = 1, job = "F" }
Any help will be appreciated.
List<Test1> test1 = new List<Test1>();
test1.Add(new Test1() { part = 1 , job = "A"});
test1.Add(new Test1() { part = 1 , job = "B"});
test1.Add(new Test1() { part = 1, job = "C" });
List<Test2> test2 = new List<Test2>();
test2.Add(new Test2() { part = 1, job = "D" });
test2.Add(new Test2() { part = 1, job = "E" });
test2.Add(new Test2() { part = 1, job = "F" });
public class Test1
{
public int part { get; set; }
public string job { get; set; }
}
public class Test2
{
public int part { get; set; }
public string job { get; set; }
}