A
Allan Ebdrup
I have a public sealed Class A that implements the interface I.
Now I want to pass an ICollection<A> as a parameter to a method that takes a
parameter of the type ICollection<I> but I get the error:
Can't convert from System.Collections.Generic<A> to
System.Collections.Generic<I>
Shouldn't I be able to pass ICollection<A> to a method that takes
ICollection<I> when A implements I ?
Do I really need to cast ICollection<A> to ICollection<I> before passing it?
Kind Regards,
Allan Ebdrup
Now I want to pass an ICollection<A> as a parameter to a method that takes a
parameter of the type ICollection<I> but I get the error:
Can't convert from System.Collections.Generic<A> to
System.Collections.Generic<I>
Shouldn't I be able to pass ICollection<A> to a method that takes
ICollection<I> when A implements I ?
Do I really need to cast ICollection<A> to ICollection<I> before passing it?
Kind Regards,
Allan Ebdrup