Get Dictionary value

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am just wondering: is there another way to get a IDictionary value
using:

String value = config["key"].ToString();

Is does not feel C# to have something like config["key"].

But that's just me ....

Thanks,
Miguel
 
shapper said:
Hello,

I am just wondering: is there another way to get a IDictionary value
using:

String value = config["key"].ToString();

Is does not feel C# to have something like config["key"].

But that's just me ....

Probably. But, if you really want to know other alternatives when using
a specific type, it's helpful to read the documentation for that type.

For example:
http://msdn.microsoft.com/en-us/library/system.collections.idictionary_members.aspx

If you can't find what you're looking for there, then it's not in the type.

Note that if you're using the generic IDictionary<TKey, TValue>
interface, the answer is different:
http://msdn.microsoft.com/en-us/library/12s2hdf3.aspx

Pete
 
Back
Top