阅读背景:

如何根据类型将类型转换为通用版本?

来源:互联网 

I'm having a spot of trouble with generics in C#. I have to store a number of generic objects together but their type parameter differs so I have made a non-generic interface which they implement. What I'm looking for is a way to convert back to the generic version, given a type object. I know I can do it with reflection but I was wondering if there was a better/more elegant solution.I'm having a spot of trouble with generics in C




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: