Currently we only apply correlated collection optimization of the subquery doesn't have any result operators. We should allow AsQueryable, for cases like this:
var query = ctx.LevelOne.Select(l1 => new
{
l1.Id,
Collection = l1.OneToMany_Optional.AsQueryable().Include(l2 => l2.OneToOne_Required_FK).ToList()
});
i.e. to apply include on a collection when the source qsre is not projected directly (#12181 has more details)
Currently we only apply correlated collection optimization of the subquery doesn't have any result operators. We should allow AsQueryable, for cases like this:
i.e. to apply include on a collection when the source qsre is not projected directly (#12181 has more details)