Skip to content

Commit

Permalink
Fix PartnerServerName check in GetAzureSqlDatabaseReplicationLink.cs (#…
Browse files Browse the repository at this point in the history
…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 <Yeming.Liu@microsoft.com>

Co-authored-by: Yeming Liu <Yeming.Liu@microsoft.com>
  • Loading branch information
alecbain and isra-fel authored Nov 9, 2020
1 parent 916643b commit 211fadd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Sql/Sql/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
## Upcoming Release
* Fixed issues where Set-AzSqlDatabaseAudit were not support Hyperscale database and database edition cannot be determined
* Added MaintenanceConfigurationId to 'New-AzSqlInstance' and 'Set-AzSqlInstance'
* Fixed a bug in GetAzureSqlDatabaseReplicationLink.cs where PartnerServerName parameter was being checked for by value instead of key

## Version 2.11.1
* Fixed issue where New-AzSqlDatabaseExport fails if networkIsolation not specified [#13097]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected override IEnumerable<AzureReplicationLinkModel> GetEntity()
{
ICollection<AzureReplicationLinkModel> results;

if (MyInvocation.BoundParameters.ContainsKey(PartnerServerName) && !WildcardPattern.ContainsWildcardCharacters(PartnerServerName))
if (MyInvocation.BoundParameters.ContainsKey(nameof(PartnerServerName)) && !WildcardPattern.ContainsWildcardCharacters(PartnerServerName))
{
results = new List<AzureReplicationLinkModel>();
results.Add(ModelAdapter.GetLink(this.ResourceGroupName, this.ServerName, this.DatabaseName, this.PartnerResourceGroupName, this.PartnerServerName));
Expand Down

0 comments on commit 211fadd

Please sign in to comment.