How can i join Master-Detail-Detail Tables with Linq in Entity Framework
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
};
精彩评论