刚刚学习 LINQ,我在我的测试项目中遇到了新手路障。你能解释一下我做错了什么吗?
public List<ToDoListInfo> retrieveLists(int UserID)
{
//Integrate userid specification later - need to add listUser table first
IQueryable<ToDoListInfo> lists =
from l in db.ToDoLists
select new ToDoListInfo {
ListID = l.ListID,
ListName = l.ListName,
Order = l.Order,
Completed = l.Completed
};
return lists.ToList<ToDoListInfo>;
}
我收到一条错误消息:
无法将方法组“ToList”转换为非委托类型“System.Collections.Generic.List”您打算调用该方法吗?