EF Core linq and conditional include and theninclude problem
问题 I am having a problem with getting a result when trying to get objects with multiple levels. This is what I am trying to do roughly: _context.Investors.Where(s => s.Id == userId) .Include(c => c.Coins) //only want this if some kind of flag is given by the user. .ThenInclude(ct => ct.CoinType) .Include(c => c.Bricks) //only want this if some kind of flag is given by the user. Essentially I am getting a lot of flags indicating if I should include parts of the object. I got it almost to work.