Rajeev Punhani
How to merge two lists in c#?
By Rajeev Punhani in .NET on Mar 17 2016
  • Bidyasagar Mishra
    Jul, 2019 10

    EXAMPLE:

    1. List<string> list1 = new List<string>();
    2. List<string> list2 = new List<string>();
    3. var combined = list1.Concat(list2);

    • 0
  • Rajeev Punhani
    Mar, 2016 17

    List employees = new List() { new Employee { EmpID = 1 , Name ="Martin"}, new Employee { EmpID = 2 , Name ="Peter"}, new Employee { EmpID = 3 , Name ="Michael"}, new Employee { EmpID = 3 , Name ="Michael"} }; List employees2 = new List() { new Employee { EmpID = 1 , Name ="Abundantcode"}, new Employee { EmpID = 2 , Name ="Best Programmer"}, new Employee { EmpID = 3 , Name ="Mike"}, new Employee { EmpID = 3 , Name ="Michael"} }; var MergedEmployees = employees.Union(employees2).ToList();

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS