Subsonic 3 + LINQ bug

无人久伴 提交于 2019-12-02 05:29:39

Yes, i think there's a bug when subsonic try to project into new typed class (non anonymous and non source class).

Your query will work fine if you do like this

var q = from g in Product.All()
       select new{
            gname = g.Name,
            name = g.Name,
            w = g.Weight.Value
       };

or if you do like this

var q = from g in Product.All()
       select g;

As a solution, please fork my repository (http://github.com/funky81/SubSonic-3.0/commit/aa7a9c1b564b2667db7fbd41e09ab72f5d58dcdb). You can see my source code and apply it into your subsonic code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!