2010-03-08 83 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()