我想创建一个包含两个参数的方法定义,一个类型类,但是 [英] I want to create a method definition that includes two parameters, one of type class, but

查看:57
本文介绍了我想创建一个包含两个参数的方法定义,一个类型类,但是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以上帝的名义

hi

我想创建一个包含两个参数的方法定义,其中一个是类型类,但是类的名称是指定运行时间,输出为列表

In the Name OF God
hi
I want to create a method definition that includes two parameters, one of them is type class, but the name of class at run time is specified and the output is a list

推荐答案

尝试:

Try:
private List<T> MyMethod<T>(T myClass, object otherParam)
    {
    List<T> ret = new List<T>();
    ...
    return ret;
    }


这篇关于我想创建一个包含两个参数的方法定义,一个类型类,但是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆