I have 2 lists from database for US and CA.
List<Order> caList = DB.GetOrderData(Countries.CA);
List<Order> usList = DB.GetOrdersData(Countries.US);
I want to iterate both lists into 1 list using array element "US" and "CA" with foreach loop.
string[] countries = {'US','CA'};
foreach(){
}
I was able to combine 2 lists into 1 list using uslist.AddRange(calist)
and it works.
co-worker told me this is another way to do it using foreach
. I am new to IT and C#, I don't know where to start and couldn't figure it out the solution so asking fellow expert programmers for assistance to expand my c# knowledge. Thank you.