Entity Framework Core async / wait deadlock when using a one-to-many relationship and WebApi

I ran into a dead end when using the asynchronous implementation of the EF Core provider.

Let's say I have the following models:

public class Player
{
    public string PlayerId { get; set;}

    public string Name { get; set;}

    public List<Game> Games { get; set;}
}

public class Game
{
    public string GameId { get; set; }

    public string PlayerId { get; set; }
    public Player Player { get; set;}
}

Now I want to run the following query:

ctx.Players
.Include(p => p.Games)
.Where(p => p.PlayerId == "123")
.Select(p => new {
    PlayerId = p.PlayerId,
    Games = p.Games.ToList()
}).ToListAsync();

When I run this code through Console Application / XUnit test, it works as excluded ... But when I run it through ASP.Net WebApi, it comes to a standstill and never ends ...

ConfigureAwait (false) , , , . , System.Interactive.Async, EFCore. , : https://github.com/Reactive-Extensions/Rx.NET/blob/develop/Ix.NET/Source/System.Interactive.Async/ToAsyncEnumerable.cs#L72 " ", .

- , , ?

, "", ...

: StackTrace: (. ToEnumerable)

Not Flagged 21672 5 Worker Thread grpc 0 (cq 0) System.Interactive.Async.dll! System.Linq.AsyncEnumerable. ToEnumerable _ mscorlib.dll! System.Threading.Monitor.Wait( obj, int millisecondsTimeout, bool exitContext) mscorlib.dll! System.Threading.Monitor.Wait( obj, int millisecondsTimeout) mscorlib.dll! System.Threading.ManualResetEventSlim.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Threading.Tasks.Task.SpinThenBlockingWait(int millisecondsTimeout, System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Threading.Tasks.Task.InternalWait(int millisecondsTimeout, System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification) mscorlib.dll! System.Threading.Tasks.Task.Result.get() System.Interactive.Async.dll! System.Linq.AsyncEnumerable.ToEnumerable_ (System.Collections.Generic.IAsyncEnumerable source) mscorlib.dll! System.Collections.Generic.List.List( System.Collections.Generic.IEnumerable) System.Core.dll! System.Linq.Enumerable.ToList(System.Collections.Generic.IEnumerable source) [ ] Microsoft.EntityFrameworkCore.dll! Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.SelectAsyncEnumerable.SelectAsyncEnumerator.MoveNext(System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult( bool) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( bool) NG.Data.Spanner.EF.dll! NG.Data.Spanner.EF.Query.Internal.SpannerAsyncQueryingEnumerable.SpannerAsyncEnumerator.MoveNext(System.Threading.CancellationToken cancelationToken) 55 [ ] mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult( bool) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( bool) Microsoft.EntityFrameworkCore.dll! Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.SelectAsyncEnumerable.SelectAsyncEnumerator.MoveNext(System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult( bool) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( bool) Microsoft.EntityFrameworkCore.Relational.dll! Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.MoveNext(System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult( bool) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( bool) Microsoft.EntityFrameworkCore.Relational.dll! Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.BufferlessMoveNext( bool, System.Threading.CancellationToken cancelationToken) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks. currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Threading.Tasks.TaskCompletionSource.TrySetResult(System.__ Canon result) Microsoft.EntityFrameworkCore.Relational.dll! System.Threading.Tasks.TaskExtensions.Cast.AnonymousMethod__0 (System.Threading.Tasks.Task t) mscorlib.dll! System.Threading.Tasks.ContinuationTaskFromResultTask.InnerInvoke() mscorlib.dll! System.Threading.Tasks.Task.Execute() mscorlib.dll! System.Threading.Tasks.Task.ExecutionContextCallback( obj) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) mscorlib.dll! System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) mscorlib.dll! System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline( System.Threading.Tasks.Task, bool taskWasPreviouslyQueued) mscorlib.dll! System.Threading.Tasks.TaskScheduler.TryRunInline( System.Threading.Tasks.Task, bool taskWasPreviouslyQueued) mscorlib.dll! System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue( System.Threading.Tasks.Task, bool needsProtection) mscorlib.dll! System.Threading.Tasks.StandardTaskContinuation.Run(System.Threading.Tasks.Task completedTask, bool bCanInlineContinuationTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( ) NG.Data.Spanner.EF.dll! NG.Data.Spanner.EF.Storage.Internal.SpannerRelationalCommand.ExecuteAsync( Microsoft.EntityFrameworkCore.Storage.IRelationalConnection, executeMethod, System.Collections.Generic.IReadOnlyDictionary parameterValues, bool closeConnection, System.Threading.CancellationToken cancelationToken) 41 [ ] mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( ) NG.Data.Spanner.EF.dll! NG.Data.Spanner.EF.Storage.Internal.SpannerRelationalCommand.ExecuteAsync(NG.Data.Spanner.EF.Storage.Internal.IOBehavior ioBehavior, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, string executeMethod, System.Collections.Generic.IReadOnlyDictionary parameterValues, bool closeConnection, System.Threading.CancellationToken cancelationToken) 128 [ ] mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback , , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) MSCORLIB.dll! NG.Data.Spanner.dll! NG.Data.Spanner.SpannerCommand.ExecuteDbDataReaderAsync( System.Data.CommandBehavior, System.Threading.CancellationToken cancelationToken) 67 [ ] mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( Google.Cloud.Spanner.V1.ResultSet) NG.Data.Spanner.dll! NG.Data.Spanner.SpannerConnection.RunQuery( commandText) 118 [ ] mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult( Google.Cloud.Spanner.V1.ResultSet) Google.Api.Gax.Grpc.dll! Google.Api.Gax.Grpc.ApiCallRetryExtensions.WithRetry.AnonymousMethod__0 (Google.Cloud.Spanner.V1.ExecuteSqlRequest , Google.Api.Gax.Grpc.CallSettings callSettings) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext( stateMachine) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0() mscorlib.dll! System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() mscorlib.dll! System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction( System.Action, bool allowInlining, ref System.Threading.Tasks.Task currentTask) mscorlib.dll! System.Threading.Tasks.Task.FinishContinuations() mscorlib.dll! System.Threading.Tasks.Task.FinishStageThree() mscorlib.dll! System.Threading.Tasks.Task.TrySetResult(System.__ Canon result) mscorlib.dll! System.Threading.Tasks.TaskCompletionSource.TrySetResult(System.__ Canon result) mscorlib.dll! System.Threading.Tasks.TaskCompletionSource.SetResult(System.__ Canon result) Grpc.Core.dll! Grpc.Core.Internal.AsyncCall.HandleUnaryResponse(bool success, Grpc.Core.Internal.ClientSideStatus receivedStatus, byte [] Message, Grpc.Core.Metadata responseHeaders) Grpc.Core.dll! Grpc.Core.Internal.CallSafeHandle.StartUnary.AnonymousMethod__0 (bool success, Grpc.Core.Internal.BatchContextSafeHandle ) Grpc.Core.dll! Grpc.Core.Internal.CompletionRegistry.HandleBatchCompletion(bool success, Grpc.Core.Internal.BatchContextSafeHandle ctx, Grpc.Core.Internal.BatchCompletionDelegate callback) Grpc.Core.dll! Grpc.Core.Internal.CompletionRegistry.RegisterBatchCompletion.AnonymousMethod__0 (bool success) Grpc.Core.dll! Grpc.Core.Internal.GrpcThreadPool.RunHandlerLoop(Grpc.Core.Internal.CompletionQueueSafeHandle cq, Grpc.Core.Profiling.IProfiler optionalProfiler) Grpc.Core.dll! Grpc.Core.Internal.GrpcThreadPool.CreateAndStartThread.AnonymousMethod__0() mscorlib.dll! System.Threading.ThreadHelper.ThreadStart_Context ( ) mscorlib.dll! System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executeContext, System.Threading.ContextCallback callback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, , bool preserveSyncCtx) mscorlib.dll! System.Threading.ExecutionContext.Run( System.Threading.ExecutionContextContext, System.Threading.ContextCallback, ) mscorlib.dll! System.Threading.ThreadHelper.ThreadStart()

+4
2

, . :

EF Core Google Spanner db. Google Spanner DotNet API - API ( ).

API API gRPC, , API gRPC (the gRPC ) - gRPC.

EFCore ToEnumerable "", System.Interactive.Async lib. ToEnumerable " ", . gRPC , ...

:

GrpcEnvironment.SetCompletionQueueCount(1);

, gRPC.

. ...

, , EFCore System.Interactive.Async lib ToEnumerable... ( async).

Edit: : EF Core Google Spanner db: https://github.com/NoGame/NG.Data.Spanner

+1

, Games . :

.Select(p => new {
    PlayerId = p.PlayerId,
    Games = p.Games.ToList() // sync over async is blocking
}).ToListAsync();

, ( EF, ):

.Select(p => new {
    PlayerId = p.PlayerId,
    Games = p.Games // let the provider handle the enumeration materialization
}).ToListAsync();

, . , , , EF Core, , ( , ). , , .Include() EF Core. EF, , , "", , , .

0

Source: https://habr.com/ru/post/1675059/


All Articles