dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.65k stars 3.15k forks source link

ToListAsync never returns back after query execution #9293

Closed dixitsuneel closed 1 year ago

dixitsuneel commented 7 years ago

We just upgraded to EF Core 2.0 Preview 2 and I have seen this issue in EF COre 1.1

For some of our queries we want to fetch parent records, but then we also find the related child records in one db call.

so we have our query outlined as this

await query.Select(parent=> new { ParentPropertiesProjections.. ChildCollectionModel = parent.ChildCollection.Select(t=> ....) }.ToListAsync();

I see in the logs that EF does fire the query to get all the parent tables data, but doesn't produce any more logs after that and then the query never returns back.

If this scenario is not supported, then the EF core framework should throw an exception for such instead of silently killing the thread.

I don't see anything in logs at all to provide you details on it.

Any guidance is greatly appreciated.

I am running EF Core 2.0 on Windows 10 machine with VS 2017 Enterprise 15.3 Preview 6 against Sql Server

BenjiZombie commented 7 years ago

See #9128

divega commented 7 years ago

This seems to be in fact a duplicate of #9363.