-1
我得到'objType' is a variable but is used like a type
编译器错误,当我尝试下面的代码:将泛型使用完全合格的类名称与思考
Type objType = Type.GetType(objFullyQualifiedName);
object jsonObj= JsonConvert.DeserializeObject<objType> (jsonString);
如何传递我从完全合格的类名获取到的类型DeserializeObject方法?
感谢您指出非泛型方法,我会使用它。你能否提供一个例子,说明如果可能的话我将能够调用通用版本? –
Check out http://stackoverflow.com/questions/232535/how-do-i-use-reflection-to-call-a-generic-method –