Skip to content

Commit 32afc35

Browse files
committed
PR feedback
1 parent 9c8e754 commit 32afc35

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,12 +772,23 @@ internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)
772772
|| dataSource.Contains(PBI_DATAWAREHOUSE3);
773773
}
774774

775+
/// <summary>
776+
/// Represents a collection of Azure SQL Server endpoint URLs for various regions and environments.
777+
/// </summary>
778+
/// <remarks>This array includes endpoint URLs for Azure SQL in global, Germany, US Government,
779+
/// China, and Fabric environments. These endpoints are used to identify and interact with Azure SQL services
780+
/// in their respective regions or environments.</remarks>
775781
internal static readonly string[] s_azureSqlServerEndpoints = { AZURE_SQL,
776782
AZURE_SQL_GERMANY,
777783
AZURE_SQL_USGOV,
778784
AZURE_SQL_CHINA,
779785
AZURE_SQL_FABRIC };
780786

787+
/// <summary>
788+
/// Contains endpoint strings for Azure SQL Server on-demand services.
789+
/// Each entry is a combination of the ONDEMAND_PREFIX and a specific Azure SQL endpoint string.
790+
/// Example format: "ondemand.database.windows.net".
791+
/// </summary>
781792
internal static readonly string[] s_azureSqlServerOnDemandEndpoints = { ONDEMAND_PREFIX + AZURE_SQL,
782793
ONDEMAND_PREFIX + AZURE_SQL_GERMANY,
783794
ONDEMAND_PREFIX + AZURE_SQL_USGOV,
@@ -823,9 +834,8 @@ private static bool IsEndpoint(string dataSource, string[] endpoints)
823834
}
824835

825836
// check if servername ends with any endpoints
826-
for (int index = 0; index < endpoints.Length; index++)
837+
foreach (var endpoint in endpoints)
827838
{
828-
string endpoint = endpoints[index];
829839
if (length > endpoint.Length)
830840
{
831841
if (string.Compare(dataSource, length - endpoint.Length, endpoint, 0, endpoint.Length, StringComparison.OrdinalIgnoreCase) == 0)

0 commit comments

Comments
 (0)