public class Student
{
public int ID{get;set;}
public string Name{get;set;}
}
public T GetModule(T obj,string where)
{
//怎么通过传递的类型赋值
//要求:1.根据传递的SQL语句查询一条记录
//2.把查询的数据赋值到T obj中
//3.最后返回已赋值的obj;
}
//调用
public void Main()
{
Student st=GetModule<Student>(new Student(),"select * from Student where ID=1");
}
红颜莎娜