读书人

急未能找出类型或命名空间名称“T”

发布时间: 2012-08-16 12:02:16 作者: rapoo

急!未能找到类型或命名空间名称“T”
小弟要定义一个以List<T>为返回值的函数,代码如下:
public List<T> FindAllAsObject(ref T t,string colname)
{
MongoCursor<T> allobjects = this.database[colname].FindAllAs<T>();
List<T> results = new List<T>();
foreach (T result in allobjects)
{

results.Add(result);

}
return results;
}
系统总提示未能找到类型或命名空间“T”
我已经引用了system.collection.generic

[解决办法]
public List<T> FindAllAsObject<T>(ref T t,string colname)
加上这个
[解决办法]
public List<T> FindAllAsObject<T>(ref T t, string colname)
[解决办法]

探讨
public List<T> FindAllAsObject<T>(ref T t, string colname)

[解决办法]
探讨

public List<T> FindAllAsObject<T>(ref T t, string colname)

读书人网 >C#

热点推荐