阅读背景:

如何约束泛型类型必须有一个带有某些参数的construtor?

来源:互联网 

I have a wrapper generic class that intended to be used with a set of types. Those types are generated by a utility and are all derived from a base class ClientBase. While ClientBase has only a default constructor, all generated types have default constructor as well as a constructor takes a string as parameter. In the constructor of the wrapper class, I instantiate an instance of the type with the constructor that takes a string. Here is a sample code: I have a wrapper generic class that intended to




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

分享到: