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.

Include of child entities is ignored with complex where clause (ef 2.1-preview)

See original GitHub issue

Include 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pgroenecommented, Apr 17, 2018

@ajcvickers I use preview1 at the moment, I’ll try to make a runnable sample which demonstrates the issue.

0reactions
divegacommented, Apr 30, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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