It is relevant to a technical discussion I'm participating in.
You're talking about generic covariance - but it doesn't apply to List<T>
, which is invariant.
It does apply to IEnumerable<T>
though:
IEnumerable<ChildClass> children = new List<ChildClass>();
IEnumerable<ParentClass> parents = children;
I think you mean Covariance and Contravariance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With