I know, I have other options, e.g. I could maintain a separate list of keys. Please don\'t suggest other options. I simply want to know if I can pull this off. Please don\'t
Either use Dictionary instead of non-generic version. Or use CastTo extension method. See http://msdn.microsoft.com/en-us/library/system.collections.icollection.aspx for details on non-generic collection returned by Hastable.Key as well link to casting method you can use.