Skip to content

Commit aa5b7e9

Browse files
committed
Resolve remaing issues
1 parent bce4e60 commit aa5b7e9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,11 @@ internal static IPAddress[] GetDnsIpAddresses(string serverName, TimeoutTimer ti
342342
args0: serverName,
343343
args1: remainingTimeout);
344344
using CancellationTokenSource cts = new CancellationTokenSource(remainingTimeout);
345-
// using this overload to support netstandard
346-
//TODO Refactor?
347-
Task<IPAddress[]> task = Dns.GetHostAddressesAsync(serverName);
348-
task.ConfigureAwait(false);
349-
task.Wait(cts.Token);
350-
return task.Result;
345+
346+
return Dns.GetHostAddressesAsync(serverName, cts.Token)
347+
.ConfigureAwait(false)
348+
.GetAwaiter()
349+
.GetResult();
351350
}
352351
}
353352

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs

-2
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,6 @@ internal static string GetLocalDBInstance(string dataSource, out bool error)
526526
string instanceName = null;
527527
ReadOnlySpan<char> input = dataSource.AsSpan().TrimStart();
528528
error = false;
529-
// NetStandard 2.0 does not support passing a string to ReadOnlySpan<char>
530-
//TODO Refactor?
531529
int index = input.IndexOf(LocalDbHost.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase);
532530
if (input.StartsWith(LocalDbHost_NP.AsSpan().Trim(), StringComparison.InvariantCultureIgnoreCase))
533531
{

0 commit comments

Comments
 (0)