Created
October 10, 2013 17:29
-
-
Save guyellis/6922284 to your computer and use it in GitHub Desktop.
How to convert an IEnumerable to a dictionary using LINQ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you want to convert an IEnumerable to a dictionary using LINQ then do: | |
Dictionary<string, object> dict = myList.ToDictionary(a => a.MyString, a => a.MyObject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment