Skip to content

Commit 45a3228

Browse files
committed
per feedback
1 parent 4dc83ed commit 45a3228

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,14 @@ The following sample tries to open a connection to an invalid database to simula
20902090
<summary>
20912091
Gets or sets the <see cref="SspiContextProvider"/> instance for customizing the SSPI context. If not set, the default for the platform will be used.
20922092
</summary>
2093+
<value>
2094+
An <see cref="T:Micorosft.Data.SqlClient.SspiContextProvider" /> instance.
2095+
</value>
2096+
<remarks>
2097+
<para>
2098+
The SspiContextProvider is a part of the connection pool key. Care should be taken when using this property to ensure the implementation returns a stable identity per resource.
2099+
</para>
2100+
</remarks>
20932101
</SspiContextProvider>
20942102
<State>
20952103
<summary>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ public string AccessToken
708708
}
709709

710710
// Need to call ConnectionString_Set to do proper pool group check
711-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: value, accessTokenCallback: null, sspiContextProvider: _sspiContextProvider));
711+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: value, accessTokenCallback: null, sspiContextProvider: null));
712712
_accessToken = value;
713713
}
714714
}
@@ -731,7 +731,7 @@ public Func<SqlAuthenticationParameters, CancellationToken, Task<SqlAuthenticati
731731
CheckAndThrowOnInvalidCombinationOfConnectionOptionAndAccessTokenCallback((SqlConnectionString)ConnectionOptions);
732732
}
733733

734-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: null, accessTokenCallback: value, sspiContextProvider: _sspiContextProvider));
734+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: null, accessTokenCallback: value, sspiContextProvider: null));
735735
_accessTokenCallback = value;
736736
}
737737
}
@@ -742,7 +742,7 @@ public SspiContextProvider SspiContextProvider
742742
get { return _sspiContextProvider; }
743743
set
744744
{
745-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: null, accessTokenCallback: _accessTokenCallback, sspiContextProvider: value));
745+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, credential: _credential, accessToken: null, accessTokenCallback: null, sspiContextProvider: value));
746746
_sspiContextProvider = value;
747747
}
748748
}
@@ -1044,7 +1044,7 @@ public SqlCredential Credential
10441044
_credential = value;
10451045

10461046
// Need to call ConnectionString_Set to do proper pool group check
1047-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, accessToken: _accessToken, accessTokenCallback: _accessTokenCallback, _sspiContextProvider));
1047+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, accessToken: _accessToken, accessTokenCallback: _accessTokenCallback, sspiContextProvider: null));
10481048
}
10491049
}
10501050

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public SspiContextProvider SspiContextProvider
611611
get { return _sspiContextProvider; }
612612
set
613613
{
614-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, null, _accessTokenCallback, value));
614+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, accessToken: null, accessTokenCallback: null, sspiContextProvider: value));
615615
_sspiContextProvider = value;
616616
}
617617
}
@@ -744,7 +744,7 @@ public string AccessToken
744744

745745
_accessToken = value;
746746
// Need to call ConnectionString_Set to do proper pool group check
747-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, _accessToken, null, _sspiContextProvider));
747+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, _accessToken, null, sspiContextProvider: null));
748748
}
749749
}
750750

@@ -766,7 +766,7 @@ public Func<SqlAuthenticationParameters, CancellationToken, Task<SqlAuthenticati
766766
CheckAndThrowOnInvalidCombinationOfConnectionOptionAndAccessTokenCallback((SqlConnectionString)ConnectionOptions);
767767
}
768768

769-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, null, value, _sspiContextProvider));
769+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, null, value, sspiContextProvider: null));
770770
_accessTokenCallback = value;
771771
}
772772
}
@@ -1079,7 +1079,7 @@ public SqlCredential Credential
10791079
_credential = value;
10801080

10811081
// Need to call ConnectionString_Set to do proper pool group check
1082-
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, _accessToken, _accessTokenCallback, _sspiContextProvider));
1082+
ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential, _accessToken, _accessTokenCallback, sspiContextProvider: null));
10831083
}
10841084
}
10851085

0 commit comments

Comments
 (0)