在范型中接口和实例间转换的问题Why No? .net 2.0 Generic cast Type From Instance to Interface

来源:互联网 发布:手机淘宝6.8.0版本安装 编辑:程序博客网 时间:2024/05/21 06:54

Since OO age ,we were used to cast a interface from Instance class,  like this:

Iuser iu=new User();

that's  natural and easy , i like it;

however in .NET2.0 , have a new&hot feature call "generic" ,can write code less than beforetime,

but,when i try to write some code mixing interface/instance & generic , i got a big problem

this :

           List  ius = new List();

or this:

           List  us = new List();

anyway impossible!

anyone would like to give me some suggestions?




原创粉丝点击