@@ -94,8 +94,8 @@ public class OAuthConnectionInfo : IConnectionInfo
9494 [ Obsolete ( "This constructor has been replaced with OAuthConnectionInfo.WithClientCredentials" ) ]
9595 public OAuthConnectionInfo ( string clientId , string clientSecret )
9696 {
97- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
98- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
97+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
98+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
9999
100100 ClientId = clientId ;
101101 ClientSecret = clientSecret ;
@@ -128,9 +128,9 @@ public OAuthConnectionInfo(string clientId, string clientSecret)
128128 [ Obsolete ( "This constructor has been replaced with OAuthConnectionInfo.WithAuthorizationCode" ) ]
129129 public OAuthConnectionInfo ( string clientId , string clientSecret , string authorizationCode , OnTokenRefreshedDelegate onTokenRefreshed , string redirectUri = null , string codeVerifier = null )
130130 {
131- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
132- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
133- if ( string . IsNullOrEmpty ( authorizationCode ) ) throw new ArgumentNullException ( nameof ( authorizationCode ) ) ;
131+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
132+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
133+ ArgumentNullException . ThrowIfEmpty ( authorizationCode ) ;
134134
135135 ClientId = clientId ;
136136 ClientSecret = clientSecret ;
@@ -165,9 +165,9 @@ public OAuthConnectionInfo(string clientId, string clientSecret, string authoriz
165165 [ Obsolete ( "This constructor has been replaced with OAuthConnectionInfo.WithRefreshToken" ) ]
166166 public OAuthConnectionInfo ( string clientId , string clientSecret , string refreshToken , string accessToken , OnTokenRefreshedDelegate onTokenRefreshed )
167167 {
168- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
169- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
170- if ( string . IsNullOrEmpty ( refreshToken ) ) throw new ArgumentNullException ( nameof ( refreshToken ) ) ;
168+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
169+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
170+ ArgumentNullException . ThrowIfEmpty ( refreshToken ) ;
171171
172172 ClientId = clientId ;
173173 ClientSecret = clientSecret ;
@@ -191,9 +191,9 @@ public OAuthConnectionInfo(string clientId, string clientSecret, string refreshT
191191 [ Obsolete ( "This constructor has been replaced with OAuthConnectionInfo.ForServerToServer" ) ]
192192 public OAuthConnectionInfo ( string clientId , string clientSecret , string accountId , OnTokenRefreshedDelegate onTokenRefreshed )
193193 {
194- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
195- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
196- if ( string . IsNullOrEmpty ( accountId ) ) throw new ArgumentNullException ( nameof ( accountId ) ) ;
194+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
195+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
196+ ArgumentNullException . ThrowIfEmpty ( accountId ) ;
197197
198198 ClientId = clientId ;
199199 ClientSecret = clientSecret ;
@@ -265,8 +265,8 @@ public static OAuthConnectionInfo WithClientCredentials(string clientId, string
265265 /// <returns>The connection info.</returns>
266266 public static OAuthConnectionInfo WithClientCredentials ( string clientId , string clientSecret , string accessToken , OnTokenRefreshedDelegate onTokenRefreshed )
267267 {
268- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
269- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
268+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
269+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
270270
271271 return new OAuthConnectionInfo
272272 {
@@ -305,9 +305,9 @@ public static OAuthConnectionInfo WithClientCredentials(string clientId, string
305305 /// <returns>The connection info.</returns>
306306 public static OAuthConnectionInfo WithAuthorizationCode ( string clientId , string clientSecret , string authorizationCode , OnTokenRefreshedDelegate onTokenRefreshed , string redirectUri = null , string codeVerifier = null )
307307 {
308- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
309- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
310- if ( string . IsNullOrEmpty ( authorizationCode ) ) throw new ArgumentNullException ( nameof ( authorizationCode ) ) ;
308+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
309+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
310+ ArgumentNullException . ThrowIfEmpty ( authorizationCode ) ;
311311
312312 return new OAuthConnectionInfo
313313 {
@@ -361,9 +361,9 @@ public static OAuthConnectionInfo WithRefreshToken(string clientId, string clien
361361 /// <returns>The connection info.</returns>
362362 public static OAuthConnectionInfo WithRefreshToken ( string clientId , string clientSecret , string refreshToken , string accessToken , OnTokenRefreshedDelegate onTokenRefreshed )
363363 {
364- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
365- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
366- if ( string . IsNullOrEmpty ( refreshToken ) ) throw new ArgumentNullException ( nameof ( refreshToken ) ) ;
364+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
365+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
366+ ArgumentNullException . ThrowIfEmpty ( refreshToken ) ;
367367
368368 return new OAuthConnectionInfo
369369 {
@@ -416,9 +416,9 @@ public static OAuthConnectionInfo ForServerToServer(string clientId, string clie
416416 /// <returns>The connection info.</returns>
417417 public static OAuthConnectionInfo ForServerToServer ( string clientId , string clientSecret , string accountId , string accessToken , OnTokenRefreshedDelegate onTokenRefreshed = null )
418418 {
419- if ( string . IsNullOrEmpty ( clientId ) ) throw new ArgumentNullException ( nameof ( clientId ) ) ;
420- if ( string . IsNullOrEmpty ( clientSecret ) ) throw new ArgumentNullException ( nameof ( clientSecret ) ) ;
421- if ( string . IsNullOrEmpty ( accountId ) ) throw new ArgumentNullException ( nameof ( accountId ) ) ;
419+ ArgumentNullException . ThrowIfEmpty ( clientId ) ;
420+ ArgumentNullException . ThrowIfEmpty ( clientSecret ) ;
421+ ArgumentNullException . ThrowIfEmpty ( accountId ) ;
422422
423423 return new OAuthConnectionInfo
424424 {
0 commit comments