|
44 | 44 | using System;
|
45 | 45 | using System.Collections.Generic;
|
46 | 46 | using System.Threading.Tasks;
|
| 47 | +using System.Linq; |
47 | 48 |
|
48 | 49 | #if !NETFX_CORE
|
49 | 50 |
|
@@ -143,12 +144,13 @@ public class ConnectionFactory : ConnectionFactoryBase, IConnectionFactory
|
143 | 144 | /// <summary>
|
144 | 145 | /// Default SASL auth mechanisms to use.
|
145 | 146 | /// </summary>
|
146 |
| - public static readonly AuthMechanismFactory[] DefaultAuthMechanisms = { new PlainMechanismFactory() }; |
| 147 | + public static readonly IList<AuthMechanismFactory> DefaultAuthMechanisms = |
| 148 | + new List<AuthMechanismFactory>(){ new PlainMechanismFactory() }; |
147 | 149 |
|
148 | 150 | /// <summary>
|
149 | 151 | /// SASL auth mechanisms to use.
|
150 | 152 | /// </summary>
|
151 |
| - public AuthMechanismFactory[] AuthMechanisms = DefaultAuthMechanisms; |
| 153 | + public IList<AuthMechanismFactory> AuthMechanisms = DefaultAuthMechanisms; |
152 | 154 |
|
153 | 155 | /// <summary>
|
154 | 156 | /// Set to true to enable automatic connection recovery.
|
@@ -212,7 +214,7 @@ public ConnectionFactory()
|
212 | 214 | }
|
213 | 215 |
|
214 | 216 | /// <summary>
|
215 |
| - /// The AMQP connection target. |
| 217 | + /// Connection endpoint. |
216 | 218 | /// </summary>
|
217 | 219 | public AmqpTcpEndpoint Endpoint
|
218 | 220 | {
|
@@ -285,12 +287,12 @@ public Uri uri
|
285 | 287 | /// Given a list of mechanism names supported by the server, select a preferred mechanism,
|
286 | 288 | /// or null if we have none in common.
|
287 | 289 | /// </summary>
|
288 |
| - public AuthMechanismFactory AuthMechanismFactory(string[] mechanismNames) |
| 290 | + public AuthMechanismFactory AuthMechanismFactory(IList<string> mechanismNames) |
289 | 291 | {
|
290 | 292 | // Our list is in order of preference, the server one is not.
|
291 | 293 | foreach (AuthMechanismFactory factory in AuthMechanisms)
|
292 | 294 | {
|
293 |
| - if (Array.Exists(mechanismNames, x => string.Equals(x, factory.Name, StringComparison.OrdinalIgnoreCase))) |
| 295 | + if (mechanismNames.Any<string>(x => string.Equals(x, factory.Name, StringComparison.OrdinalIgnoreCase))) |
294 | 296 | {
|
295 | 297 | return factory;
|
296 | 298 | }
|
|
0 commit comments