public override async Task <TResponse> UnaryServerHandler <TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod <TRequest, TResponse> continuation) { using (var scope = _serviceProvider.CreateScope()) { ScopeServiceProvider.Current = scope; var unitOfWork = CreateUnitOfWork(continuation.GetMethodInfo()); var response = await continuation(request, context); if (unitOfWork != null) { await unitOfWork.CompleteAsync(); } return(response); } }