C# Get Keys from a Dictionary<string, Stream>

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-16T16:58:39Z Indexed on 2010/03/16 17:01 UTC
Read the original article Hit count: 236

Filed under:
|
|

Suppose I have a Dictionary like so:

Dictionary<string, Stream>

How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible?

I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this.

In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.

© Stack Overflow or respective owner

Related posts about c#

Related posts about generics