From 3b409bae36269312a11046877f61ec6a9951a531 Mon Sep 17 00:00:00 2001 From: Dragos Avadanei Date: Fri, 28 Apr 2017 16:15:52 -0700 Subject: [PATCH] addressing CR feedback: using nameof, discarding redundant parameter set clauses --- .../Commands/BackupAzureKeyVaultKey.cs | 12 -- .../Commands/BackupAzureKeyVaultSecret.cs | 12 -- .../Models/KeyVaultDataServiceClient.cs | 164 +++++++++--------- 3 files changed, 82 insertions(+), 106 deletions(-) diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs index 293872589865..0d776900eaf3 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultKey.cs @@ -85,13 +85,7 @@ public class BackupAzureKeyVaultKey : KeyVaultCmdletBase [Parameter( Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, - ParameterSetName = ByKeyNameParameterSet, HelpMessage = "Output file. The output file to store the backed up key blob in. If not present, a default filename is chosen.")] - [Parameter( Mandatory = false, - Position = 2, - ValueFromPipelineByPropertyName = true, - ParameterSetName = ByKeyObjectParameterSet, - HelpMessage = "Output file. The output file to store the backed up key blob in. If not present, a default filename is chosen." )] [ValidateNotNullOrEmpty] public string OutputFile { get; set; } @@ -101,12 +95,6 @@ public class BackupAzureKeyVaultKey : KeyVaultCmdletBase [Parameter( Mandatory = false, Position = 3, ValueFromPipelineByPropertyName = true, - ParameterSetName = ByKeyNameParameterSet, - HelpMessage = "Overwrite the given file if it exists" )] - [Parameter( Mandatory = false, - Position = 3, - ValueFromPipelineByPropertyName = true, - ParameterSetName = ByKeyObjectParameterSet, HelpMessage = "Overwrite the given file if it exists" )] public SwitchParameter Force { get; set; } diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultSecret.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultSecret.cs index 79ee36fda151..8c510f19fb59 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultSecret.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands/BackupAzureKeyVaultSecret.cs @@ -86,12 +86,6 @@ public class BackupAzureKeyVaultSecret : KeyVaultCmdletBase [Parameter( Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, - ParameterSetName = BySecretNameParameterSet, - HelpMessage = "Output file. The output file to store the backed up secret blob in. If not present, a default filename is chosen." )] - [Parameter( Mandatory = false, - Position = 2, - ValueFromPipelineByPropertyName = true, - ParameterSetName = BySecretObjectParameterSet, HelpMessage = "Output file. The output file to store the backed up secret blob in. If not present, a default filename is chosen." )] [ValidateNotNullOrEmpty] public string OutputFile { get; set; } @@ -102,12 +96,6 @@ public class BackupAzureKeyVaultSecret : KeyVaultCmdletBase [Parameter( Mandatory = false, Position = 3, ValueFromPipelineByPropertyName = true, - ParameterSetName = BySecretNameParameterSet, - HelpMessage = "Overwrite the given file if it exists" )] - [Parameter( Mandatory = false, - Position = 3, - ValueFromPipelineByPropertyName = true, - ParameterSetName = BySecretObjectParameterSet, HelpMessage = "Overwrite the given file if it exists" )] public SwitchParameter Force { get; set; } diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs index d3d12c2c4f45..30f3f3c4db11 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs @@ -34,9 +34,9 @@ internal class KeyVaultDataServiceClient : IKeyVaultDataServiceClient public KeyVaultDataServiceClient(IAuthenticationFactory authFactory, AzureContext context) { if (authFactory == null) - throw new ArgumentNullException("authFactory"); + throw new ArgumentNullException(nameof(authFactory)); if (context == null) - throw new ArgumentNullException("context"); + throw new ArgumentNullException(nameof(context)); if (context.Environment == null) throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment); @@ -58,11 +58,11 @@ public KeyVaultDataServiceClient() public KeyBundle CreateKey(string vaultName, string keyName, KeyAttributes keyAttributes) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) - throw new ArgumentNullException("keyAttributes"); + throw new ArgumentNullException(nameof(keyAttributes)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var attributes = (Azure.KeyVault.Models.KeyAttributes)keyAttributes; @@ -89,11 +89,11 @@ public KeyBundle CreateKey(string vaultName, string keyName, KeyAttributes keyAt public CertificateBundle MergeCertificate(string vaultName, string certName, X509Certificate2Collection certs, IDictionary tags) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) - throw new ArgumentNullException("certName"); + throw new ArgumentNullException(nameof(certName)); if (null == certs) - throw new ArgumentNullException("certs"); + throw new ArgumentNullException(nameof(certs)); CertificateBundle certBundle; @@ -115,11 +115,11 @@ public CertificateBundle MergeCertificate(string vaultName, string certName, X50 public CertificateBundle ImportCertificate(string vaultName, string certName, string base64CertColl, SecureString certPassword, IDictionary tags) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) - throw new ArgumentNullException("certName"); + throw new ArgumentNullException(nameof(certName)); if (string.IsNullOrEmpty(base64CertColl)) - throw new ArgumentNullException("base64CertColl"); + throw new ArgumentNullException(nameof(base64CertColl)); CertificateBundle certBundle; @@ -149,11 +149,11 @@ public CertificateBundle ImportCertificate(string vaultName, string certName, st public CertificateBundle ImportCertificate(string vaultName, string certName, X509Certificate2Collection certificateCollection, IDictionary tags) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) - throw new ArgumentNullException("certName"); + throw new ArgumentNullException(nameof(certName)); if (null == certificateCollection) - throw new ArgumentNullException("certificateCollection"); + throw new ArgumentNullException(nameof(certificateCollection)); CertificateBundle certBundle; var vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -179,13 +179,13 @@ public CertificateBundle ImportCertificate(string vaultName, string certName, X5 public KeyBundle ImportKey(string vaultName, string keyName, KeyAttributes keyAttributes, JsonWebKey webKey, bool? importToHsm) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) - throw new ArgumentNullException("keyAttributes"); + throw new ArgumentNullException(nameof(keyAttributes)); if (webKey == null) - throw new ArgumentNullException("webKey"); + throw new ArgumentNullException(nameof(webKey)); if (webKey.Kty == JsonWebKeyType.RsaHsm && (importToHsm.HasValue && !importToHsm.Value)) throw new ArgumentException(KeyVaultProperties.Resources.ImportByokAsSoftkeyError); @@ -214,11 +214,11 @@ public KeyBundle ImportKey(string vaultName, string keyName, KeyAttributes keyAt public KeyBundle UpdateKey(string vaultName, string keyName, string keyVersion, KeyAttributes keyAttributes) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) - throw new ArgumentNullException("keyAttributes"); + throw new ArgumentNullException(nameof(keyAttributes)); var attributes = (Azure.KeyVault.Models.KeyAttributes)keyAttributes; var keyIdentifier = new KeyIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), keyName, keyVersion); @@ -240,7 +240,7 @@ public KeyBundle UpdateKey(string vaultName, string keyName, string keyVersion, public Contacts GetCertificateContacts(string vaultName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -261,9 +261,9 @@ public Contacts GetCertificateContacts(string vaultName) public CertificateBundle GetCertificate(string vaultName, string certName, string certificateVersion) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) - throw new ArgumentNullException("certName"); + throw new ArgumentNullException(nameof(certName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -284,9 +284,9 @@ public CertificateBundle GetCertificate(string vaultName, string certName, strin public KeyBundle GetKey(string vaultName, string keyName, string keyVersion) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -306,7 +306,7 @@ public KeyBundle GetKey(string vaultName, string keyName, string keyVersion) public IEnumerable GetCertificates(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -335,7 +335,7 @@ public IEnumerable GetCertificates(KeyVaultObjectFilter public IEnumerable GetCertificateVersions(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -366,7 +366,7 @@ public IEnumerable GetCertificateVersions(KeyVaultObjec public IEnumerable GetKeys(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -395,7 +395,7 @@ public IEnumerable GetKeys(KeyVaultObjectFilterOptions options) public IEnumerable GetKeyVersions(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -426,9 +426,9 @@ public IEnumerable GetKeyVersions(KeyVaultObjectFilterOptions o public KeyBundle DeleteKey(string vaultName, string keyName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -448,9 +448,9 @@ public KeyBundle DeleteKey(string vaultName, string keyName) public Contacts SetCertificateContacts(string vaultName, Contacts contacts) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (null == contacts) - throw new ArgumentNullException("contacts"); + throw new ArgumentNullException(nameof(contacts)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -471,13 +471,13 @@ public Contacts SetCertificateContacts(string vaultName, Contacts contacts) public Secret SetSecret(string vaultName, string secretName, SecureString secretValue, SecretAttributes secretAttributes) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) - throw new ArgumentNullException("secretName"); + throw new ArgumentNullException(nameof(secretName)); if (secretValue == null) - throw new ArgumentNullException("secretValue"); + throw new ArgumentNullException(nameof(secretValue)); if (secretAttributes == null) - throw new ArgumentNullException("secretAttributes"); + throw new ArgumentNullException(nameof(secretAttributes)); string value = secretValue.ConvertToString(); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -500,11 +500,11 @@ public Secret SetSecret(string vaultName, string secretName, SecureString secret public Secret UpdateSecret(string vaultName, string secretName, string secretVersion, SecretAttributes secretAttributes) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) - throw new ArgumentNullException("secretName"); + throw new ArgumentNullException(nameof(secretName)); if (secretAttributes == null) - throw new ArgumentNullException("secretAttributes"); + throw new ArgumentNullException(nameof(secretAttributes)); var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion); @@ -527,9 +527,9 @@ public Secret UpdateSecret(string vaultName, string secretName, string secretVer public Secret GetSecret(string vaultName, string secretName, string secretVersion) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) - throw new ArgumentNullException("secretName"); + throw new ArgumentNullException(nameof(secretName)); var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion); SecretBundle secret; @@ -548,7 +548,7 @@ public Secret GetSecret(string vaultName, string secretName, string secretVersio public IEnumerable GetSecrets(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -576,7 +576,7 @@ public IEnumerable GetSecrets(KeyVaultObjectFilterOptions op public IEnumerable GetSecretVersions(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); if (string.IsNullOrEmpty(options.Name)) @@ -605,9 +605,9 @@ public IEnumerable GetSecretVersions(KeyVaultObjectFilterOpt public CertificateOperation EnrollCertificate(string vaultName, string certificateName, CertificatePolicy certificatePolicy, IDictionary tags) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -628,9 +628,9 @@ public CertificateOperation EnrollCertificate(string vaultName, string certifica public CertificateBundle UpdateCertificate(string vaultName, string certificateName, string certificateVersion, CertificateAttributes certificateAttributes, IDictionary tags) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); var certificateIdentifier = new CertificateIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), certificateName, certificateVersion); @@ -651,9 +651,9 @@ public CertificateBundle UpdateCertificate(string vaultName, string certificateN public CertificateBundle DeleteCertificate(string vaultName, string certName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) - throw new ArgumentNullException("certName"); + throw new ArgumentNullException(nameof(certName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -674,9 +674,9 @@ public CertificateBundle DeleteCertificate(string vaultName, string certName) public CertificateOperation GetCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -697,9 +697,9 @@ public CertificateOperation GetCertificateOperation(string vaultName, string cer public CertificateOperation CancelCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -720,9 +720,9 @@ public CertificateOperation CancelCertificateOperation(string vaultName, string public CertificateOperation DeleteCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -743,9 +743,9 @@ public CertificateOperation DeleteCertificateOperation(string vaultName, string public Secret DeleteSecret(string vaultName, string secretName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) - throw new ArgumentNullException("secretName"); + throw new ArgumentNullException(nameof(secretName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -765,11 +765,11 @@ public Secret DeleteSecret(string vaultName, string secretName) public string BackupKey(string vaultName, string keyName, string outputBlobPath) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) - throw new ArgumentNullException("keyName"); + throw new ArgumentNullException(nameof(keyName)); if (string.IsNullOrEmpty(outputBlobPath)) - throw new ArgumentNullException("outputBlobPath"); + throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -791,9 +791,9 @@ public string BackupKey(string vaultName, string keyName, string outputBlobPath) public KeyBundle RestoreKey(string vaultName, string inputBlobPath) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(inputBlobPath)) - throw new ArgumentNullException("inputBlobPath"); + throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); @@ -815,11 +815,11 @@ public KeyBundle RestoreKey(string vaultName, string inputBlobPath) public string BackupSecret( string vaultName, string secretName, string outputBlobPath ) { if ( string.IsNullOrEmpty( vaultName ) ) - throw new ArgumentNullException( "vaultName" ); + throw new ArgumentNullException(nameof(vaultName)); if ( string.IsNullOrEmpty( secretName ) ) - throw new ArgumentNullException( "secretName" ); + throw new ArgumentNullException(nameof(secretName)); if ( string.IsNullOrEmpty( outputBlobPath ) ) - throw new ArgumentNullException( "outputBlobPath" ); + throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -841,9 +841,9 @@ public string BackupSecret( string vaultName, string secretName, string outputBl public Secret RestoreSecret( string vaultName, string inputBlobPath ) { if ( string.IsNullOrEmpty( vaultName ) ) - throw new ArgumentNullException( "vaultName" ); + throw new ArgumentNullException(nameof(vaultName)); if ( string.IsNullOrEmpty( inputBlobPath ) ) - throw new ArgumentNullException( "inputBlobPath" ); + throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); @@ -865,9 +865,9 @@ public Secret RestoreSecret( string vaultName, string inputBlobPath ) public CertificatePolicy GetCertificatePolicy(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -887,11 +887,11 @@ public CertificatePolicy GetCertificatePolicy(string vaultName, string certifica public CertificatePolicy UpdateCertificatePolicy(string vaultName, string certificateName, CertificatePolicy certificatePolicy) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) - throw new ArgumentNullException("certificateName"); + throw new ArgumentNullException(nameof(certificateName)); if (certificatePolicy == null) - throw new ArgumentNullException("certificatePolicy"); + throw new ArgumentNullException(nameof(certificatePolicy)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificatePolicy resultantCertificatePolicy; @@ -911,9 +911,9 @@ public CertificatePolicy UpdateCertificatePolicy(string vaultName, string certif public IssuerBundle GetCertificateIssuer(string vaultName, string issuerName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) - throw new ArgumentNullException("issuerName"); + throw new ArgumentNullException(nameof(issuerName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); @@ -933,7 +933,7 @@ public IssuerBundle GetCertificateIssuer(string vaultName, string issuerName) public IEnumerable GetCertificateIssuers(KeyVaultObjectFilterOptions options) { if (options == null) - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); @@ -968,11 +968,11 @@ public IssuerBundle SetCertificateIssuer( KeyVaultCertificateOrganizationDetails organizationDetails) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) - throw new ArgumentNullException("issuerName"); + throw new ArgumentNullException(nameof(issuerName)); if (string.IsNullOrEmpty(issuerProvider)) - throw new ArgumentNullException("issuerProvider"); + throw new ArgumentNullException(nameof(issuerProvider)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var issuer = new IssuerBundle @@ -1012,9 +1012,9 @@ public IssuerBundle SetCertificateIssuer( public IssuerBundle DeleteCertificateIssuer(string vaultName, string issuerName) { if (string.IsNullOrEmpty(vaultName)) - throw new ArgumentNullException("vaultName"); + throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) - throw new ArgumentNullException("issuerName"); + throw new ArgumentNullException(nameof(issuerName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);