1010
1111namespace RabbitMQ . AMQP . Client . Impl
1212{
13+ /// <summary>
14+ /// <para>
15+ /// <see cref="AmqpEnvironment"/> is the implementation of <see cref="IEnvironment"/>.
16+ /// </para>
17+ /// <para>
18+ /// The <see cref="CreateConnectionAsync()"/> method allows creating <see cref="IConnection"/> instances.
19+ /// </para>
20+ /// </summary>
1321 public class AmqpEnvironment : IEnvironment
1422 {
1523 private ConnectionSettings ConnectionSettings { get ; }
@@ -23,12 +31,24 @@ private AmqpEnvironment(ConnectionSettings connectionSettings, IMetricsReporter?
2331 _metricsReporter = metricsReporter ;
2432 }
2533
26- // TODO to play nicely with IoC containers, we should not have static Create methods
34+ /// <summary>
35+ /// Create a new <see cref="IEnvironment"/> instance, using the provided <see cref="ConnectionSettings"/>
36+ /// and optional <see cref="IMetricsReporter"/>
37+ /// </summary>
38+ /// <param name="connectionSettings"></param>
39+ /// <param name="metricsReporter"></param>
40+ /// <returns><see cref="IEnvironment"/> instance.</returns>
2741 public static IEnvironment Create ( ConnectionSettings connectionSettings , IMetricsReporter ? metricsReporter = default )
2842 {
43+ // TODO to play nicely with IoC containers, we should not have static Create methods
2944 return new AmqpEnvironment ( connectionSettings , metricsReporter ) ;
3045 }
3146
47+ /// <summary>
48+ /// Create a new <see cref="IConnection"/> instance, using the provided <see cref="ConnectionSettings"/>.
49+ /// </summary>
50+ /// <param name="connectionSettings"></param>
51+ /// <returns><see cref="Task{IConnection}"/> instance.</returns>
3252 public async Task < IConnection > CreateConnectionAsync ( ConnectionSettings connectionSettings )
3353 {
3454 IConnection c = await AmqpConnection . CreateAsync ( connectionSettings , _metricsReporter ) . ConfigureAwait ( false ) ;
@@ -49,6 +69,10 @@ public async Task<IConnection> CreateConnectionAsync(ConnectionSettings connecti
4969 return c ;
5070 }
5171
72+ /// <summary>
73+ /// Create a new <see cref="IConnection"/> instance, using the <see cref="IEnvironment"/> <see cref="ConnectionSettings"/>.
74+ /// </summary>
75+ /// <returns><see cref="Task{IConnection}"/> instance.</returns>
5276 public Task < IConnection > CreateConnectionAsync ( )
5377 {
5478 if ( ConnectionSettings is null )
@@ -59,6 +83,10 @@ public Task<IConnection> CreateConnectionAsync()
5983 return CreateConnectionAsync ( ConnectionSettings ) ;
6084 }
6185
86+ /// <summary>
87+ /// Close this environment and its resources.
88+ /// </summary>
89+ /// <returns><see cref="Task"/></returns>
6290 // TODO cancellation token
6391 public Task CloseAsync ( )
6492 {
0 commit comments