Generic class type with dictionary in C#
I have a dictionary and I would like the key to be able to be different
classes. Right now I'm using:
public Dictionary<dynamic,int> CbList = new Dictionary<dynamic,int>();
This works but I lose the compile-time checking. Is there a better way?
EDIT:
Basically I was wondering if there was a way to have different classes in
a dictionary without losing compile-time checking....
The key classes are related in that they have the same contructors...
No comments:
Post a Comment