开发者

Doing joins with SubSonic/ActiveRecord easily?

开发者 https://www.devze.com 2023-01-05 20:54 出处:网络
I am using SubSonic with the A开发者_C百科ctiveRecord template. I like it pretty well so far but can not figure out how to do a join query. I have read this link but the generated class templates it c

I am using SubSonic with the A开发者_C百科ctiveRecord template. I like it pretty well so far but can not figure out how to do a join query. I have read this link but the generated class templates it creates does not have anything of type IColumn

Is there something I am missing here? Also, I am using SubSonic 3.0


You can use simple Linq queries to do joins with Subsonic.

For example:

var products = from p in Product.All()
               join od in OrderDetail.All() on p.ProductID equals od.ProductID
               select p;
0

精彩评论

暂无评论...
验证码 换一张
取 消