Skip to content

Commit ecfca89

Browse files
committed
PR feedback
1 parent 32afc35 commit ecfca89

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
using Microsoft.Identity.Client;
2525
using Microsoft.SqlServer.Server;
2626
using System.Security.Authentication;
27+
using System.Linq;
28+
2729

2830
#if NETFRAMEWORK
2931
using System.Reflection;
@@ -762,16 +764,6 @@ internal static Version GetAssemblyVersion()
762764
private const string AZURE_SQL_CHINA = ".database.chinacloudapi.cn";
763765
private const string AZURE_SQL_FABRIC = ".database.fabric.microsoft.com";
764766

765-
internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)
766-
{
767-
return IsEndpoint(dataSource, s_azureSqlServerOnDemandEndpoints)
768-
|| dataSource.Contains(AZURE_SYNAPSE)
769-
|| dataSource.Contains(FABRIC_DATAWAREHOUSE)
770-
|| dataSource.Contains(PBI_DATAWAREHOUSE)
771-
|| dataSource.Contains(PBI_DATAWAREHOUSE2)
772-
|| dataSource.Contains(PBI_DATAWAREHOUSE3);
773-
}
774-
775767
/// <summary>
776768
/// Represents a collection of Azure SQL Server endpoint URLs for various regions and environments.
777769
/// </summary>
@@ -794,7 +786,25 @@ internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)
794786
ONDEMAND_PREFIX + AZURE_SQL_USGOV,
795787
ONDEMAND_PREFIX + AZURE_SQL_CHINA,
796788
ONDEMAND_PREFIX + AZURE_SQL_FABRIC };
797-
789+
/// <summary>
790+
/// Represents a collection of endpoint identifiers for Azure Synapse and related services.
791+
/// </summary>
792+
/// <remarks>This array contains predefined endpoint strings used to identify Azure Synapse and
793+
/// associated services, such as Fabric Data Warehouse and Power BI Data Warehouse.</remarks>
794+
internal static readonly string[] s_azureSynapseEndpoints = { AZURE_SYNAPSE,
795+
FABRIC_DATAWAREHOUSE,
796+
PBI_DATAWAREHOUSE,
797+
PBI_DATAWAREHOUSE2,
798+
PBI_DATAWAREHOUSE3 };
799+
800+
internal static readonly string[] s_azureSynapseOnDemandEndpoints = s_azureSqlServerOnDemandEndpoints
801+
.Concat(s_azureSynapseEndpoints)
802+
.ToArray();
803+
internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)
804+
{
805+
return IsEndpoint(dataSource, s_azureSynapseOnDemandEndpoints);
806+
}
807+
798808
internal static bool IsAzureSqlServerEndpoint(string dataSource)
799809
{
800810
return IsEndpoint(dataSource, s_azureSqlServerEndpoints);

0 commit comments

Comments
 (0)