From e7b55df6c5bf40121f339c435b1d5cdbbb9a8e73 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 22 Jul 2020 15:04:33 -0700 Subject: [PATCH] Fix blocking call in FindByEmailAsync (#24116) --- src/Identity/EntityFrameworkCore/src/UserStore.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Identity/EntityFrameworkCore/src/UserStore.cs b/src/Identity/EntityFrameworkCore/src/UserStore.cs index 4709916a12..362d046548 100644 --- a/src/Identity/EntityFrameworkCore/src/UserStore.cs +++ b/src/Identity/EntityFrameworkCore/src/UserStore.cs @@ -322,7 +322,6 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore return UserLogins.SingleOrDefaultAsync(userLogin => userLogin.LoginProvider == loginProvider && userLogin.ProviderKey == providerKey, cancellationToken); } - /// /// Adds the given to the specified . /// @@ -637,7 +636,7 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); - return Task.FromResult(Users.Where(u => u.NormalizedEmail == normalizedEmail).SingleOrDefault()); + return Users.SingleOrDefaultAsync(u => u.NormalizedEmail == normalizedEmail); } /// @@ -719,7 +718,6 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore return Task.CompletedTask; } - /// /// Remove a new user token. ///