JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

C# Type传参转换成泛型T

发布时间 2023-06-13 12:02:01作者: 糯米白白
public class Test{
   public void Export<T1, T2>()
    {
      
    }
 
 
    public void ExportByClassName(string typename1,string typename2)
    {
        Type t1 = Type.GetType(typename1);
        Type t2 = Type.GetType(typename2);
        MethodInfo mi = this.GetType().GetMethod("Export").MakeGenericMethod(new Type[] { t1,t2});
        mi.Invoke(this,null);
    }
}

https://blog.csdn.net/fgfg12345/article/details/45098639

    本栏目推荐文章
  • vue报错:Module parse failed: Unexpected token (5:2) You may need an appropriate loader to handle this file type.
  • mybatis解决nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping:
  • 记录用<input type="file">取代<video><canvas>
  • SpringMVC中如何设置响应的Content-Type(源码分析)
  • 从content-type设置看Spring MVC处理header的一个坑
  • EF CodeFirst mysql 迁移异常Unable to create a 'DbContext' of type
  • Element implicitly has an 'any' type because expression of type 'string' can't be used to index type
  • python 报错TypeError: object of type ‘NoneType‘ has no len()处理
  • TypeVariable、GenericDeclaration、Type、AnnotatedType
  • Bean无法注入问题 NoSuchBeanDefinitionException: No qualifying bean of type 'Service.UserService' available: expected at least 1 bean which qualifies as autowire candidate
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们