I have class
T
, implementing interface
IBar
.
I have a variable list
of type List<T>
.
Two questions for enhancing my understanding of the language:
Why doesn't this work?
var foo = (ICollection <IBar>)list; // fails!
How to work around it (if possible)?