Storing a generic class in a dictionary
Is it possible to store a generic class object in a Dictionary? If so, how?
I've got an abstract generic class, Comparison<T>, and several concrete inherited generic classes. The actual types will be determined by a configuration file at runtime. I need to store a collection of any number of any combination of these inherited classes. Since they will all be Comparison types I was hoping to use a Dictionary to store them, but since the actual type T may well differ between them, can I do this, or do I need to revert to a Hashtable?
Dictionary
<string, Comparison<T>> comparisons =newDictionary<string, Comparison<T>>();
