Listlist1 = new List () { 1, 2, 3 }; List list2 = new List () { 4, 5, 6 }; List concatenatedList = list1.Concat(list2).ToList();
ListIn this example, we have three lists of strings and we are using the Concat method to concatenate them into a single list. The resultant list will contain { "apple", "banana", "orange", "grapes", "pineapple", "watermelon" }. The System.Windows.Documents namespace is part of the WPF (Windows Presentation Foundation) package library in C#.list1 = new List () { "apple", "banana", "orange" }; List list2 = new List () { "grapes", "pineapple" }; List list3 = new List () { "watermelon" }; List concatenatedList = list1.Concat(list2).Concat(list3).ToList();