From d1585617f9147daa2d8a29c2efb04f0eeb49d5ae Mon Sep 17 00:00:00 2001 From: Caleb Nelton Date: Wed, 17 Feb 2016 09:20:46 -0600 Subject: [PATCH] Fixed parameter "role" cannot be resolved Use 'nameof(*)' expression instead. --- .../RoleManager.cs | 18 +- .../UserManager.cs | 168 +++++++++--------- 2 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/Microsoft.AspNetCore.Identity/RoleManager.cs b/src/Microsoft.AspNetCore.Identity/RoleManager.cs index 8dd42b45a3..e7c30ce0c9 100644 --- a/src/Microsoft.AspNetCore.Identity/RoleManager.cs +++ b/src/Microsoft.AspNetCore.Identity/RoleManager.cs @@ -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); } diff --git a/src/Microsoft.AspNetCore.Identity/UserManager.cs b/src/Microsoft.AspNetCore.Identity/UserManager.cs index bc561f5a5d..1a0635177a 100644 --- a/src/Microsoft.AspNetCore.Identity/UserManager.cs +++ b/src/Microsoft.AspNetCore.Identity/UserManager.cs @@ -258,11 +258,11 @@ namespace Microsoft.AspNetCore.Identity } /// - /// Gets a flag indicating whether the backing user store supports returning + /// Gets a flag indicating whether the backing user store supports returning /// collections of information. /// /// - /// true if the backing user store supports returning collections of + /// true if the backing user store supports returning collections of /// information, otherwise false. /// public virtual bool SupportsQueryableUsers @@ -353,7 +353,7 @@ namespace Microsoft.AspNetCore.Identity } /// - /// Creates the specified in the backing store with no password, + /// Creates the specified in the backing store with no password, /// as an asynchronous operation. /// /// The user to create. @@ -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); } /// - /// Creates the specified in the backing store with given password, + /// Creates the specified in the backing store with given password, /// as an asynchronous operation. /// /// The user to create. @@ -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 } /// - /// Returns a flag indicating whether the given is valid for the + /// Returns a flag indicating whether the given is valid for the /// specified . /// /// The user whose password should be validated. @@ -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 /// /// Generates a password reset token for the specified , using - /// the configured password reset token provider. + /// the configured password reset token provider. /// /// The user to generate a password reset token for. - /// The that represents the asynchronous operation, + /// The that represents the asynchronous operation, /// containing a password reset token for the specified . public virtual Task 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 } /// - /// Sets the phone number for the specified if the specified + /// Sets the phone number for the specified if the specified /// change is valid. /// /// The user whose phone number to set. @@ -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; } /// - /// Gets a list of valid two factor token providers for the specified , + /// Gets a list of valid two factor token providers for the specified , /// as an asynchronous operation. /// /// The user the whose two factor authentication providers will be returned. @@ -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(); 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 /// /// The user whose two factor authentication enabled status should be retrieved. /// - /// The that represents the asynchronous operation, true if the specified + /// The that represents the asynchronous operation, true if the specified /// has two factor authentication enabled, otherwise false. /// public virtual async Task 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 /// /// The user whose locked out status should be retrieved. /// - /// The that represents the asynchronous operation, true if the specified + /// The that represents the asynchronous operation, true if the specified /// is locked out, otherwise false. /// public virtual async Task 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 } /// - /// 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. /// /// The user whose failed access count to increment. @@ -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 } /// - /// Retrieves the current number of failed accesses for the given . + /// Retrieves the current number of failed accesses for the given . /// /// The user whose access failed count should be retrieved for. /// The 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);