I am trying to query the collection and child collection using EF 7. Here is the code:
public async Task < List < Table >> GetAllTable() { var tableList = await db.Tables.Include(o => o.Checks.Select(i => i.CheckItems)).ToListAsync(); return tableList; }
I follow the syntax here is MSDN . However, when I run this code, I get the following error. Does anyone know what's wrong here? Thanks!
InvalidCastException: cannot use an object of type 'Remotion.Linq.Clauses.Expressions.SubQueryExpression' to enter type 'System.Linq.Expressions.MemberExpression'. ** Microsoft.Data.Entity.Query.EntityQueryModelVisitor.b__30_2 (<> f__AnonymousType2`2 <> h__TransparentIdentifier0)
source share