在把字符串反序列化到对象的时候,我需要给IList<TableInfo> ls 这样的对象填充数据,但我去不可能用obj = Activator.CreateInstance(typeof(ls))来创建对像,因为它是一个接口,有没有什么办法动态地返回一个List的对象.
|
obj = Activator.CreateInstance(typeof(List<TableInfo>)); http://www.cnblogs.com/darkangle/archive/2007/12/16/996377.html 用反射性能恐不好吧~~看看这篇是否有些启发? |