Dynamic Dictionaries with C# 4.0

Have you ever been working with the Dictionary<TKey, TValue> object in .NET and just wanted to find some way in which you can do this:
var dictionary = new Dictionary<string, string> { { "hello", "world!" } }; … var so…


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail

Have you ever been working with the Dictionary<TKey, TValue> object in .NET and just wanted to find some way in which you can do this: var dictionary = new Dictionary<string, string> { { "hello", "world!" } }; ... var something = dictionary.hello; It’d be sweet, but it’s not possible. The dictionary is just a bucket and there isn’t a way it can know at compile type about the objects which are within it.


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail


Print Share Comment Cite Upload Translate Updates
APA

Posts on LINQ to Fail | Sciencx (2010-06-28T00:00:00+00:00) Dynamic Dictionaries with C# 4.0. Retrieved from https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/

MLA
" » Dynamic Dictionaries with C# 4.0." Posts on LINQ to Fail | Sciencx - Monday June 28, 2010, https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/
HARVARD
Posts on LINQ to Fail | Sciencx Monday June 28, 2010 » Dynamic Dictionaries with C# 4.0., viewed ,<https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/>
VANCOUVER
Posts on LINQ to Fail | Sciencx - » Dynamic Dictionaries with C# 4.0. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/
CHICAGO
" » Dynamic Dictionaries with C# 4.0." Posts on LINQ to Fail | Sciencx - Accessed . https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/
IEEE
" » Dynamic Dictionaries with C# 4.0." Posts on LINQ to Fail | Sciencx [Online]. Available: https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/. [Accessed: ]
rf:citation
» Dynamic Dictionaries with C# 4.0 | Posts on LINQ to Fail | Sciencx | https://www.scien.cx/2010/06/28/dynamic-dictionaries-with-c-4-0/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.