开发者

How can i join Master-Detail-Detail Tables with Linq in Entity Framework

开发者 https://www.devze.com 2023-01-19 07:31 出处:网络
I have 3 table a,b and c a.Id,a.code /master b.Id.b.code,b.aId,c.Id /detai开发者_如何转开发l c.Id,c.code / detail of detail

I have 3 table a,b and c

a.Id,a.code /master
b.Id.b.code,b.aId,c.Id /detai开发者_如何转开发l
c.Id,c.code / detail of detail

i will join this three table with linq and show it in grid. How can i do this?


var query = from recordA in context.TableA
            join recordB in context.TableB
            on recordA.Id equals recordB.aId
            join recordC in context.TableC
            on recordB.cId equals recordC.Id
            select new 
            {
               // whatever columns are appropriate
            };
0

精彩评论

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