question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ThenInclude Method not found

See original GitHub issue

The issue

After upgrade to 1.1.0. Run Query to load navigation property then got the error as below.

Code

   var all = db.Category.Include(c => c.CategoryPics).ThenInclude(p => p.Picture);
       var result = all.ToList();

Error

MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Query.IIncludableQueryable`2<!!0,!!2> 
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ThenInclude(Microsoft.EntityFrameworkCore.Query.IIncludableQueryable`2<!!0,System.Collections.Generic.ICollection`1<!!1>>, System.Linq.Expressions.Expression`1<System.Func`2<!!1,!!2>>)'.

Further technical details

EF Core version: 1.1.0 Operating system: Visual Studio version: VS 2015 Update 3

Other details about my project setup:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
ajcvickerscommented, Dec 5, 2016

Re-opening to discuss in triage. This is a known binary breaking change; we may consider fixing it in a patch release.

1reaction
ajcvickerscommented, Jan 6, 2017

This is fixed and merged. Leaving the bug open for patch approval.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ThenInclude not recognized in EF Core query
ThenInclude is available only when you use the Include overload with lambda expression parameter: query = query.Include(e => e.Car).
Read more >
EF core 6 then Include issue - Microsoft Q&A
In EF core 3.1 I am able to include a collection of object using include statement. After that then include is not working...
Read more >
ThenInclude Method not found · Issue #7116 · dotnet/efcore
The issue After upgrade to 1.1.0. Run Query to load navigation property then got the error as below. Code var all = db.Category....
Read more >
No way to .ThenInclude() multiple sub-properties #4716
AndInclude() method, which can be tacked onto a call to .ThenInclude() to ... The details objects are missing in the query and not...
Read more >
ThenInclude in EF Classic
The ThenInclude method moves the chaining level to the property included. It allows us to include related objects from the next level. ThenInclude...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found