From ea55615a655ae0b91e90bb8db7da15fcc4b4d546 Mon Sep 17 00:00:00 2001 From: Svyatoslav Danyliv Date: Wed, 15 Sep 2021 17:13:33 +0300 Subject: [PATCH] Corrected async -> sync execution. --- .../Internal/LinqToDBForEFQueryProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs b/Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs index 9673e96..57c8f76 100644 --- a/Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs +++ b/Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs @@ -160,7 +160,8 @@ IEnumerator IEnumerable.GetEnumerator() /// Query result as . public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken) { - return QueryProvider.ExecuteAsyncEnumerable(Expression, cancellationToken).Result.GetAsyncEnumerator(cancellationToken); + return Task.Run(() => QueryProvider.ExecuteAsyncEnumerable(Expression, cancellationToken), + cancellationToken).Result.GetAsyncEnumerator(cancellationToken); } ///