Creating a Generic Dictionary


It is great when you are in a field where you can learn at least one new thing every day.  For example, I've been using generics since they became available in .Net 2.0 and yet, somehow, this was the first time I've seen this particular way to use one of them:


Dictionary
<string, object> oProps = new Dictionary<string, object>();

This creates a strongly-typed dictionary object and that uses a string as the key and an object as a value.  Super simple and wonderfully powerful yet I had missed that in all of my readings and experimentation.  This just made my day!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s