diff --git a/src/RecoveryServices/RecoveryServices.SiteRecovery/ReplicationProtectedItem/SetAzureRmRecoveryServicesAsrReplicationProtectedItem.cs b/src/RecoveryServices/RecoveryServices.SiteRecovery/ReplicationProtectedItem/SetAzureRmRecoveryServicesAsrReplicationProtectedItem.cs index ec2fd3ef285b..89ec43ab73dd 100644 --- a/src/RecoveryServices/RecoveryServices.SiteRecovery/ReplicationProtectedItem/SetAzureRmRecoveryServicesAsrReplicationProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.SiteRecovery/ReplicationProtectedItem/SetAzureRmRecoveryServicesAsrReplicationProtectedItem.cs @@ -145,21 +145,21 @@ public class SetAzureRmRecoveryServicesAsrReplicationProtectedItem : SiteRecover /// Gets or sets target VM tags. /// [Parameter] - [ValidateNotNullOrEmpty] + [ValidateNotNull] public IDictionary RecoveryVmTag { get; set; } /// /// Gets or sets the tags for the disks. /// [Parameter] - [ValidateNotNullOrEmpty] + [ValidateNotNull] public IDictionary DiskTag { get; set; } /// /// Gets or sets the tags for the target NICs. /// [Parameter] - [ValidateNotNullOrEmpty] + [ValidateNotNull] public IDictionary RecoveryNicTag { get; set; } // @@ -458,20 +458,17 @@ public override void ExecuteSiteRecoveryCmdlet() ToDictionary(x => x.DiskId, x => x.DiskEncryptionSetId); } - if (this.RecoveryVmTag == null || - this.RecoveryVmTag.Count == 0) + if (this.RecoveryVmTag == null) { recoveryVmTag = providerSpecificDetails.TargetVmTags; } - if (this.RecoveryNicTag == null || - this.RecoveryNicTag.Count == 0) + if (this.RecoveryNicTag == null) { recoveryNicTag = providerSpecificDetails.TargetNicTags; } - if (this.DiskTag == null || - this.DiskTag.Count == 0) + if (this.DiskTag == null) { diskTag = providerSpecificDetails.TargetManagedDiskTags; } @@ -572,20 +569,17 @@ public override void ExecuteSiteRecoveryCmdlet() primaryNic = providerSpecificDetails.SelectedSourceNicId; } - if (this.RecoveryVmTag == null || - this.RecoveryVmTag.Count == 0) + if (this.RecoveryVmTag == null) { recoveryVmTag = providerSpecificDetails.TargetVmTags; } - if (this.RecoveryNicTag == null || - this.RecoveryNicTag.Count == 0) + if (this.RecoveryNicTag == null) { recoveryNicTag = providerSpecificDetails.TargetNicTags; } - if (this.DiskTag == null || - this.DiskTag.Count == 0) + if (this.DiskTag == null) { diskTag = providerSpecificDetails.TargetManagedDiskTags; }