Skip to content

Commit 211fadd

Browse files
alecbainisra-fel
andauthored
Fix PartnerServerName check in GetAzureSqlDatabaseReplicationLink.cs (#13433)
* Fix PartnerServerName check Fix check for PartnerServerName param check to look for string literal instead of value of variable. * Update ChangeLog.md * Use nameof to avoid magic string Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent 916643b commit 211fadd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Sql/Sql/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Upcoming Release
2121
* Fixed issues where Set-AzSqlDatabaseAudit were not support Hyperscale database and database edition cannot be determined
2222
* Added MaintenanceConfigurationId to 'New-AzSqlInstance' and 'Set-AzSqlInstance'
23+
* Fixed a bug in GetAzureSqlDatabaseReplicationLink.cs where PartnerServerName parameter was being checked for by value instead of key
2324

2425
## Version 2.11.1
2526
* Fixed issue where New-AzSqlDatabaseExport fails if networkIsolation not specified [#13097]

src/Sql/Sql/Replication/Cmdlet/GetAzureSqlDatabaseReplicationLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected override IEnumerable<AzureReplicationLinkModel> GetEntity()
7373
{
7474
ICollection<AzureReplicationLinkModel> results;
7575

76-
if (MyInvocation.BoundParameters.ContainsKey(PartnerServerName) && !WildcardPattern.ContainsWildcardCharacters(PartnerServerName))
76+
if (MyInvocation.BoundParameters.ContainsKey(nameof(PartnerServerName)) && !WildcardPattern.ContainsWildcardCharacters(PartnerServerName))
7777
{
7878
results = new List<AzureReplicationLinkModel>();
7979
results.Add(ModelAdapter.GetLink(this.ResourceGroupName, this.ServerName, this.DatabaseName, this.PartnerResourceGroupName, this.PartnerServerName));

0 commit comments

Comments
 (0)