2010-03-08 38 views
0

我在subsonic3新的,而且我得到了一些错误,当我尝试使用LeftJoin左连接在Subsonic3

var q = 

    from c in categories 

    join p in products on c equals p.Category into ps 

    from p in ps.DefaultIfEmpty() 

    select new { Category = c, ProductName = p == null ? "(No products)" : p.ProductName }; 

的错误是 “System.Collections.Generic.Enumerable” ... “不能被用于类型System.Linq.IQueryable的参数

有谁收到了这个错误?你解决这个问题? 感谢

+0

你可以尝试从http://github.com/subsonic/SubSonic-3.0拉最新版本,并报告你是否仍然遇到这个问题。谢谢 – 2010-03-09 20:52:00

回答

1

我不知道哪一个是IQueryable的财产,但你可能知道,只需添加.AsEnumerable()方法。

categories.AsEnumerable() or products.AsEnumerable() 

我不记得如果你还必须添加toList()方法,但你可以试试看。

categories.AsEnumerable().toList() or products.AsEnumerable().toList()