Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to combine the 2 lists into a new List using LINQ
Posted

Try
C#
var result = from item1 A item in first
                    from item1 B in second
                    select new{ A, B};
 
Share this answer
 
To add to Abinav's solution, not using Linq:
List<myClass> newList = new List<myClass>();
newList.AddRange(oldListA);
newList.AddRange(oldListB);
This has the advantage of being typesafe.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900