Possible Duplicate:
In C#, why can't a List<string> object be stored in a List<object> variable
Say that you have a class that triggers events with collections of different classes. You want to take those collections and instantiate an object that takes a List<object> as parameter to it's constructor (you need the methods of IList: indexed accessed, indexOf etc).
What is the best practice?
If the events return List or IList you have to do some nasty casting when creating it from a List of a more specific class, say List<SomeClass> because IList is invariant.
new DataObject(someClasses.Cast<object>().ToList())
You can use Enumerable<whatever> in the events, then at least you can simply do new DataObject(someClasses.ToList()) but a new List still has to be created which might have some overhead...
It seems a little weird that Lists can't be downcasted to object automatically