0
Cannot convert method group 'ToList' to non-delegate type 'System.Collections.Generic.List'. Did you intend to invoke the method? D:\PROJECTS\CECB2013-03-26\CECB\cecb.Functions\ActivationCodeEmail.cs 102 20 cecb.Functions*
我的代碼是
List<Members> teamMembers = new List<Members>();
var query = from c in cecbContext.Projects
join b in cecbContext.TeamMembers on c.proj_team equals b.team_reference
join d in cecbContext.Members on b.mem_reference equals d.mem_reference
select new
{
d.mem_reference
};
return query.ToList<Members>;
}
沒有好友泛型類型參數,然後它說的 錯誤「 System.Linq.IQueryable'不包含'ToList'的定義和最佳擴展方法重載'System.Linq.Enumerable.ToList (System.Collections.Generic.IEnumerable )'有一些無效參數 –
Gayashan
@加亞什我得到了:)我已經更新了我的答案 –
@Gayashan哦 - 你必須添加'使用System.Linq;''IQueryable .ToList()'是一個擴展方法。 –