KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The indexer into Dictionary throws an exception if the key is missing. Is there an implementation of IDictionary that instead will return default(T) ? I know about the TryGetValue() method, but that's impossible to use with LINQ. Would this efficiently do what I need?: myDict.FirstOrDefault(a => a.Key == someKeyKalue); I don't think it will as I think it will iterate the keys instead of using a Hash lookup.
Tags (comma-separated)
Save Edits
Cancel