Fixed parameter "role" cannot be resolved

Use 'nameof(*)' expression instead.
This commit is contained in:
Caleb Nelton 2016-02-17 09:20:46 -06:00 committed by Hao Kung
parent 80ba15aaf4
commit d1585617f9
2 changed files with 93 additions and 93 deletions

View File

@ -158,7 +158,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
var result = await ValidateRoleInternal(role);
if (!result.Succeeded)
@ -195,7 +195,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
return UpdateRoleAsync(role);
@ -213,7 +213,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
return Store.DeleteAsync(role, CancellationToken);
@ -231,7 +231,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (roleName == null)
{
throw new ArgumentNullException("roleName");
throw new ArgumentNullException(nameof(roleName));
}
return await FindByNameAsync(NormalizeKey(roleName)) != null;
@ -320,7 +320,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (roleName == null)
{
throw new ArgumentNullException("roleName");
throw new ArgumentNullException(nameof(roleName));
}
return Store.FindByNameAsync(NormalizeKey(roleName), CancellationToken);
@ -341,11 +341,11 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (claim == null)
{
throw new ArgumentNullException("claim");
throw new ArgumentNullException(nameof(claim));
}
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
await claimStore.AddClaimAsync(role, claim, CancellationToken);
@ -367,7 +367,7 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
await claimStore.RemoveClaimAsync(role, claim, CancellationToken);
@ -388,7 +388,7 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (role == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(role));
}
return claimStore.GetClaimsAsync(role, CancellationToken);
}

View File

@ -258,11 +258,11 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Gets a flag indicating whether the backing user store supports returning
/// Gets a flag indicating whether the backing user store supports returning
/// <see cref="IQueryable"/> collections of information.
/// </summary>
/// <value>
/// true if the backing user store supports returning <see cref="IQueryable"/> collections of
/// true if the backing user store supports returning <see cref="IQueryable"/> collections of
/// information, otherwise false.
/// </value>
public virtual bool SupportsQueryableUsers
@ -353,7 +353,7 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Creates the specified <paramref name="user"/> in the backing store with no password,
/// Creates the specified <paramref name="user"/> in the backing store with no password,
/// as an asynchronous operation.
/// </summary>
/// <param name="user">The user to create.</param>
@ -393,7 +393,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return UpdateUserAsync(user);
@ -412,7 +412,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return Store.DeleteAsync(user, CancellationToken);
@ -443,14 +443,14 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (userName == null)
{
throw new ArgumentNullException("userName");
throw new ArgumentNullException(nameof(userName));
}
userName = NormalizeKey(userName);
return Store.FindByNameAsync(userName, CancellationToken);
}
/// <summary>
/// Creates the specified <paramref name="user"/> in the backing store with given password,
/// Creates the specified <paramref name="user"/> in the backing store with given password,
/// as an asynchronous operation.
/// </summary>
/// <param name="user">The user to create.</param>
@ -465,11 +465,11 @@ namespace Microsoft.AspNetCore.Identity
var passwordStore = GetPasswordStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (password == null)
{
throw new ArgumentNullException("password");
throw new ArgumentNullException(nameof(password));
}
var result = await UpdatePasswordHash(passwordStore, user, password);
if (!result.Succeeded)
@ -510,7 +510,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await Store.GetUserNameAsync(user, CancellationToken);
}
@ -526,7 +526,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await Store.SetUserNameAsync(user, userName, CancellationToken);
@ -546,7 +546,7 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Returns a flag indicating whether the given <paramref name="password"/> is valid for the
/// Returns a flag indicating whether the given <paramref name="password"/> is valid for the
/// specified <paramref name="user"/>.
/// </summary>
/// <param name="user">The user whose password should be validated.</param>
@ -592,7 +592,7 @@ namespace Microsoft.AspNetCore.Identity
var passwordStore = GetPasswordStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return passwordStore.HasPasswordAsync(user, CancellationToken);
@ -614,7 +614,7 @@ namespace Microsoft.AspNetCore.Identity
var passwordStore = GetPasswordStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
var hash = await passwordStore.GetPasswordHashAsync(user, CancellationToken);
@ -648,7 +648,7 @@ namespace Microsoft.AspNetCore.Identity
var passwordStore = GetPasswordStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
@ -681,7 +681,7 @@ namespace Microsoft.AspNetCore.Identity
var passwordStore = GetPasswordStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await UpdatePasswordHash(passwordStore, user, null, validatePassword: false);
@ -719,7 +719,7 @@ namespace Microsoft.AspNetCore.Identity
var securityStore = GetSecurityStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await securityStore.GetSecurityStampAsync(user, CancellationToken);
}
@ -741,7 +741,7 @@ namespace Microsoft.AspNetCore.Identity
GetSecurityStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await UpdateSecurityStampInternal(user);
@ -750,10 +750,10 @@ namespace Microsoft.AspNetCore.Identity
/// <summary>
/// Generates a password reset token for the specified <paramref name="user"/>, using
/// the configured password reset token provider.
/// the configured password reset token provider.
/// </summary>
/// <param name="user">The user to generate a password reset token for.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation,
/// <returns>The <see cref="Task"/> that represents the asynchronous operation,
/// containing a password reset token for the specified <paramref name="user"/>.</returns>
public virtual Task<string> GeneratePasswordResetTokenAsync(TUser user)
{
@ -777,7 +777,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
// Make sure the token is valid and the stamp matches
@ -808,11 +808,11 @@ namespace Microsoft.AspNetCore.Identity
var loginStore = GetLoginStore();
if (loginProvider == null)
{
throw new ArgumentNullException("loginProvider");
throw new ArgumentNullException(nameof(loginProvider));
}
if (providerKey == null)
{
throw new ArgumentNullException("providerKey");
throw new ArgumentNullException(nameof(providerKey));
}
return loginStore.FindByLoginAsync(loginProvider, providerKey, CancellationToken);
}
@ -834,15 +834,15 @@ namespace Microsoft.AspNetCore.Identity
var loginStore = GetLoginStore();
if (loginProvider == null)
{
throw new ArgumentNullException("loginProvider");
throw new ArgumentNullException(nameof(loginProvider));
}
if (providerKey == null)
{
throw new ArgumentNullException("providerKey");
throw new ArgumentNullException(nameof(providerKey));
}
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await loginStore.RemoveLoginAsync(user, loginProvider, providerKey, CancellationToken);
@ -865,11 +865,11 @@ namespace Microsoft.AspNetCore.Identity
var loginStore = GetLoginStore();
if (login == null)
{
throw new ArgumentNullException("login");
throw new ArgumentNullException(nameof(login));
}
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
var existingUser = await FindByLoginAsync(login.LoginProvider, login.ProviderKey);
@ -895,7 +895,7 @@ namespace Microsoft.AspNetCore.Identity
var loginStore = GetLoginStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await loginStore.GetLoginsAsync(user, CancellationToken);
}
@ -915,11 +915,11 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (claim == null)
{
throw new ArgumentNullException("claim");
throw new ArgumentNullException(nameof(claim));
}
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return AddClaimsAsync(user, new Claim[] { claim });
}
@ -939,11 +939,11 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (claims == null)
{
throw new ArgumentNullException("claims");
throw new ArgumentNullException(nameof(claims));
}
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await claimStore.AddClaimsAsync(user, claims, CancellationToken);
@ -966,15 +966,15 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (claim == null)
{
throw new ArgumentNullException("claim");
throw new ArgumentNullException(nameof(claim));
}
if (newClaim == null)
{
throw new ArgumentNullException("newClaim");
throw new ArgumentNullException(nameof(newClaim));
}
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await claimStore.ReplaceClaimAsync(user, claim, newClaim, CancellationToken);
@ -996,11 +996,11 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (claim == null)
{
throw new ArgumentNullException("claim");
throw new ArgumentNullException(nameof(claim));
}
return RemoveClaimsAsync(user, new Claim[] { claim });
}
@ -1020,11 +1020,11 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (claims == null)
{
throw new ArgumentNullException("claims");
throw new ArgumentNullException(nameof(claims));
}
await claimStore.RemoveClaimsAsync(user, claims, CancellationToken);
@ -1044,7 +1044,7 @@ namespace Microsoft.AspNetCore.Identity
var claimStore = GetClaimStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await claimStore.GetClaimsAsync(user, CancellationToken);
}
@ -1064,7 +1064,7 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
var normalizedRole = NormalizeKey(role);
@ -1091,11 +1091,11 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (roles == null)
{
throw new ArgumentNullException("roles");
throw new ArgumentNullException(nameof(roles));
}
foreach (var role in roles.Distinct())
@ -1125,7 +1125,7 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
var normalizedRole = NormalizeKey(role);
@ -1164,11 +1164,11 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (roles == null)
{
throw new ArgumentNullException("roles");
throw new ArgumentNullException(nameof(roles));
}
foreach (var role in roles)
@ -1194,7 +1194,7 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await userRoleStore.GetRolesAsync(user, CancellationToken);
}
@ -1214,7 +1214,7 @@ namespace Microsoft.AspNetCore.Identity
var userRoleStore = GetUserRoleStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await userRoleStore.IsInRoleAsync(user, NormalizeKey(role), CancellationToken);
}
@ -1230,7 +1230,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetEmailStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetEmailAsync(user, CancellationToken);
}
@ -1250,7 +1250,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetEmailStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await store.SetEmailAsync(user, email, CancellationToken);
@ -1272,7 +1272,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetEmailStore();
if (email == null)
{
throw new ArgumentNullException("email");
throw new ArgumentNullException(nameof(email));
}
return store.FindByEmailAsync(NormalizeKey(email), CancellationToken);
}
@ -1320,7 +1320,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetEmailStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!await VerifyUserTokenAsync(user, Options.Tokens.EmailConfirmationTokenProvider, ConfirmEmailTokenPurpose, token))
@ -1346,7 +1346,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetEmailStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetEmailConfirmedAsync(user, CancellationToken);
}
@ -1380,7 +1380,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
// Make sure the token is valid and the stamp matches
@ -1406,7 +1406,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetPhoneNumberStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetPhoneNumberAsync(user, CancellationToken);
}
@ -1426,7 +1426,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetPhoneNumberStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await store.SetPhoneNumberAsync(user, phoneNumber, CancellationToken);
@ -1436,7 +1436,7 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Sets the phone number for the specified <paramref name="user"/> if the specified
/// Sets the phone number for the specified <paramref name="user"/> if the specified
/// change <paramref name="token"/> is valid.
/// </summary>
/// <param name="user">The user whose phone number to set.</param>
@ -1452,7 +1452,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetPhoneNumberStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!await VerifyChangePhoneNumberTokenAsync(user, token, phoneNumber))
@ -1480,7 +1480,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetPhoneNumberStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return store.GetPhoneNumberConfirmedAsync(user, CancellationToken);
}
@ -1546,7 +1546,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (tokenProvider == null)
{
@ -1582,7 +1582,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (tokenProvider == null)
{
@ -1606,13 +1606,13 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (provider == null)
{
throw new ArgumentNullException("provider");
throw new ArgumentNullException(nameof(provider));
}
_tokenProviders[providerName] = provider;
}
/// <summary>
/// Gets a list of valid two factor token providers for the specified <paramref name="user"/>,
/// Gets a list of valid two factor token providers for the specified <paramref name="user"/>,
/// as an asynchronous operation.
/// </summary>
/// <param name="user">The user the whose two factor authentication providers will be returned.</param>
@ -1625,7 +1625,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
var results = new List<string>();
foreach (var f in _tokenProviders)
@ -1653,7 +1653,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!_tokenProviders.ContainsKey(tokenProvider))
{
@ -1684,7 +1684,7 @@ namespace Microsoft.AspNetCore.Identity
ThrowIfDisposed();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!_tokenProviders.ContainsKey(tokenProvider))
{
@ -1701,7 +1701,7 @@ namespace Microsoft.AspNetCore.Identity
/// </summary>
/// <param name="user">The user whose two factor authentication enabled status should be retrieved.</param>
/// <returns>
/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/>
/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/>
/// has two factor authentication enabled, otherwise false.
/// </returns>
public virtual async Task<bool> GetTwoFactorEnabledAsync(TUser user)
@ -1710,7 +1710,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserTwoFactorStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetTwoFactorEnabledAsync(user, CancellationToken);
}
@ -1730,7 +1730,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserTwoFactorStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await store.SetTwoFactorEnabledAsync(user, enabled, CancellationToken);
@ -1744,7 +1744,7 @@ namespace Microsoft.AspNetCore.Identity
/// </summary>
/// <param name="user">The user whose locked out status should be retrieved.</param>
/// <returns>
/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/>
/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/>
/// is locked out, otherwise false.
/// </returns>
public virtual async Task<bool> IsLockedOutAsync(TUser user)
@ -1753,7 +1753,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!await store.GetLockoutEnabledAsync(user, CancellationToken))
{
@ -1778,7 +1778,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
await store.SetLockoutEnabledAsync(user, enabled, CancellationToken);
@ -1798,7 +1798,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetLockoutEnabledAsync(user, CancellationToken);
}
@ -1817,7 +1817,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetLockoutEndDateAsync(user, CancellationToken);
}
@ -1834,7 +1834,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (!await store.GetLockoutEnabledAsync(user, CancellationToken))
@ -1847,8 +1847,8 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Increments the access failed count for the user as an asynchronous operation.
/// If the failed access account is greater than or equal to the configured maximum number of attempts,
/// Increments the access failed count for the user as an asynchronous operation.
/// If the failed access account is greater than or equal to the configured maximum number of attempts,
/// the user will be locked out for the configured lockout time span.
/// </summary>
/// <param name="user">The user whose failed access count to increment.</param>
@ -1859,7 +1859,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
// If this puts the user over the threshold for lockout, lock them out and reset the access failed count
@ -1886,7 +1886,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
if (await GetAccessFailedCountAsync(user) == 0)
@ -1898,7 +1898,7 @@ namespace Microsoft.AspNetCore.Identity
}
/// <summary>
/// Retrieves the current number of failed accesses for the given <paramref name="user"/>.
/// Retrieves the current number of failed accesses for the given <paramref name="user"/>.
/// </summary>
/// <param name="user">The user whose access failed count should be retrieved for.</param>
/// <returns>The <see cref="Task"/> that contains the result the asynchronous operation, the current failed access count
@ -1909,7 +1909,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserLockoutStore();
if (user == null)
{
throw new ArgumentNullException("user");
throw new ArgumentNullException(nameof(user));
}
return await store.GetAccessFailedCountAsync(user, CancellationToken);
}
@ -1928,7 +1928,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetClaimStore();
if (claim == null)
{
throw new ArgumentNullException("claim");
throw new ArgumentNullException(nameof(claim));
}
return store.GetUsersForClaimAsync(claim, CancellationToken);
}
@ -1947,7 +1947,7 @@ namespace Microsoft.AspNetCore.Identity
var store = GetUserRoleStore();
if (roleName == null)
{
throw new ArgumentNullException("role");
throw new ArgumentNullException(nameof(roleName));
}
return store.GetUsersInRoleAsync(NormalizeKey(roleName), CancellationToken);