I have three tables, PTWMain, PTWSubsequent and PTWContent. The relation between them is PTWMain can have multiple PTWSubsequent but only one PTWContent and PTWSubsequent can have only one PTWContent. I try to write a query to get related data from all tables but I failed. What I tried is
C#
PTWContents = await _context.PTWContents.Include(s => s.PTWMain).Include(s => s.PTWSubsequent).ToListAsync();but this query simple ignore the PTWSubsequent. How it should be written?


Sachin SinghRank #66 · 26.2K reputationPosted Sep 3, 2021, 9:47 AM EDT
Marius VasileRank #785 · 2.9K reputationPosted Sep 3, 2021, 9:54 AM EDT