C# Casting a List as List

前端 未结 11 1528
小鲜肉
小鲜肉 2020-12-09 15:35

Why can I not cast a List as List? Why does the following not work:

internal class ObjBase
   {
   }

int         


        
11条回答
  •  -上瘾入骨i
    2020-12-09 16:03

    Covariance my friend. Look at http://blog.t-l-k.com/dot-net/2009/c-sharp-4-covariance-and-contravariance

提交回复
热议问题