With EF 6, I was querying like this and it was working nice.
IQueryable<Student> query = _testHelper.buildQuerty(id, userId)
.Include(x => x.Class)
.Include(x => x.Subjects)
.Include(x => x.Subjects.Select(y => y.Category));
Problem: The same does not work in EF Core 2.0.
Error
System.ArgumentException occurred HResult=0x80070057 Message=The property expression 'Subjects => {from Subjects y in Subjects select [y].Category}' is not valid. The expression should represent a property access: 't => t.MyProperty'. For more information on including related data, see http://go.microsoft.com/fwlink/?LinkID=746393.
Opened up link, and refactored like this but it still not working and gives same error.
List<Student> query = _testHelper.buildQuerty(id, userId)
.Include(x => x.Class)
.Include(x => x.Subjects)
.ThenInclude(Subjects => Subjects.Select(y => y.Category)).tolist();
Where is the problem?