Include of child entities is ignored with complex where clause (ef 2.1-preview)
See original GitHub issueInclude is ignored when adding a complex where clause to a query
Steps to reproduce
Create a object with child object
Make a query with a:
Include(c => c.Childs)
Add a where clause
Where(x => x == y)
Add a more complex Where clause
.Where(x=> codes.Any(c => EF.Functions.Like(x.ContractCode, c)))
Get the results:
.ToListAsync()
The include entities are not included. Expected that they are included. When leaving out the complex where, the child entities are included.
string[] items = new string[]{ 'a',b'};
await _dbContext.Parent
.Include(r => r.Chlild)
.Where(r => r.Col == "val")
.Where(r => items .Any(c => EF.Functions.Like(r, c)))
.ToListAsync();
Further technical details
EF Core version: 2.1-preview Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: windows/linux inside docker container IDE: VS latest version
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Include of child entities is ignored with complex where clause (ef ...
Include is ignored when adding a complex where clause to a query Steps to reproduce Create a object with child object Make a...
Read more >dotnet/efcore 2.1.0-preview2-final on GitHub
CommandText analyzer (#11371); Owned entity type use one type multiple times - add-migration will always find differences and therefore add the same ...
Read more >ASP.NET Core 2.1-preview1: Introducing HTTPClient factory
HttpClient factory is an opinionated factory for creating HttpClient instances to be used in your applications. It is designed to:.
Read more >What's New in NDepend
Support for Properties and Events. The NDepend code model is now filled with properties and events thanks to the new interfaces IProperty and...
Read more >Learning Discrete Mathematics
The title of this book, Learning Discrete Mathematics with ISETL raises two issues. We have chosen the word "Learning" rather than "Teaching".
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ajcvickers I use preview1 at the moment, I’ll try to make a runnable sample which demonstrates the issue.
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.
Please re-open if you are able to provide a repro.