I am trying to create a dictionary from 2 lists where one list contains keys and one list contains values. I can do it using for loop but I am trying to find if there is a way of doing it using LINQ.
Sample code will be helpfull. Thanks!!!!
I am trying to create a dictionary from 2 lists where one list contains
Share
In .NET4 you could use the built-in
Zipmethod to merge the two sequences, followed by aToDictionarycall: