What is more efficient between these two approaches
object foundItem = (from m in myList where m.ID == id select m).FirstOrDefault();
or
Dictionary<string, object> dict = myList.ToDictionary(m => m.ID, m => m);
dict.TryGetValue(id, out foundItem);
If you’re just doing one lookup, the non-dictionary one is faster because it avoids the overhead of building the dictionary.
If you’re going to do a lot of lookups on the same dataset, the dictionary one is faster because it is a data structure specifically design for fast look up by a single key. The more lookups you do, the more it is worth the overhead of building the dictionary.