You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am transforming some functions to their asynchronous version, I am using the SqlQuery method, but these asynchronous versions hang. without throwing a exception... the application is simply closed.
I made the tests in Entity Framework 6 and 8 with a simple console application with the same result
staticasync Task MyNewAsyncTest(){try{using(vardbContext=new DbContext()){// Sincronous version, These works fine!vardata= dbContext.Database.SqlQuery<string>($"select cod_empresa from si_empresa").ToList();vardata= dbContext.Database.SqlQuery<Persona>($"select grado_discapacidad_persona, nombres_persona from rh_persona").ToList();// The same but async version hang up, with primitive types or clasesvardata=await dbContext.Database.SqlQuery<string?>($"select cod_empresa from si_empresa").ToListAsync();vardata=await dbContext.Database.SqlQuery<Persona>($"select grado_discapacidad_persona, nombres_persona from rh_persona").ToListAsync();// even weirder, if I dont apply await inmediately, but wait 2 secs then it works !!! varGet1= dbContext.Database.SqlQuery<string>("select cod_empresa from si_empresa").ToListAsync();
Thread.Sleep(2000);vardata=await Get1;foreach(var i in data)
Console.WriteLine(i);}}catch(Exceptionex){
Console.WriteLine(ex.ToString());}
Console.ReadLine();}
If the data being loaded is big (e.g. big strings or binary data), then this is probably dotnet/SqlClient#593.
If not, then we need a minimal, runnable repro to investigate this further - a self-contained console program, including the database schema and some data. Basically something we can use to see the bug happening.
I am transforming some functions to their asynchronous version, I am using the SqlQuery method, but these asynchronous versions hang. without throwing a exception... the application is simply closed.
I made the tests in Entity Framework 6 and 8 with a simple console application with the same result
EF Core version: 6 and 8
Database provider: (Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (.Net Framework 4.8 and .NET Core 8.0)
Operating system: Windows 11
IDE: (Visual Studio 2022 17.8.5)
The text was updated successfully, but these errors were encountered: