99
1010namespace FluentCommand ;
1111
12+ /// <summary>
13+ /// A configuration builder class
14+ /// </summary>
1215public class DataConfigurationBuilder
1316{
1417 private readonly IServiceCollection _services ;
@@ -19,25 +22,52 @@ public class DataConfigurationBuilder
1922 private Type _queryGeneratorType ;
2023 private Type _queryLoggerType ;
2124
25+ /// <summary>
26+ /// Initializes a new instance of the <see cref="DataConfigurationBuilder"/> class.
27+ /// </summary>
28+ /// <param name="services">The services.</param>
2229 public DataConfigurationBuilder ( IServiceCollection services )
2330 {
2431 _services = services ;
2532 }
2633
2734
35+ /// <summary>
36+ /// The name of the connection to resolve the connection string from configuration.
37+ /// </summary>
38+ /// <param name="connectionName">Name of the connection.</param>
39+ /// <returns>
40+ /// The same configuration builder so that multiple calls can be chained.
41+ /// </returns>
2842 public DataConfigurationBuilder UseConnectionName ( string connectionName )
2943 {
3044 _connectionName = connectionName ;
3145 return this ;
3246 }
3347
48+ /// <summary>
49+ /// The connection string to use with fluent command.
50+ /// </summary>
51+ /// <param name="connectionString">The connection string.</param>
52+ /// <returns>
53+ /// The same configuration builder so that multiple calls can be chained.
54+ /// </returns>
3455 public DataConfigurationBuilder UseConnectionString ( string connectionString )
3556 {
3657 _connectionString = connectionString ;
3758 return this ;
3859 }
3960
4061
62+ /// <summary>
63+ /// Adds the provider factory to use with this configuration.
64+ /// </summary>
65+ /// <typeparam name="TService">The type of the service.</typeparam>
66+ /// <param name="providerFactory">The provider factory.</param>
67+ /// <returns>
68+ /// The same configuration builder so that multiple calls can be chained.
69+ /// </returns>
70+ /// <seealso cref="DbProviderFactory"/>
4171 public DataConfigurationBuilder AddProviderFactory < TService > ( TService providerFactory )
4272 where TService : DbProviderFactory
4373 {
@@ -46,6 +76,15 @@ public DataConfigurationBuilder AddProviderFactory<TService>(TService providerFa
4676 return this ;
4777 }
4878
79+ /// <summary>
80+ /// Adds the provider factory to use with this configuration.
81+ /// </summary>
82+ /// <typeparam name="TService">The type of the service.</typeparam>
83+ /// <param name="implementationFactory">The implementation factory.</param>
84+ /// <returns>
85+ /// The same configuration builder so that multiple calls can be chained.
86+ /// </returns>
87+ /// <seealso cref="DbProviderFactory"/>
4988 public DataConfigurationBuilder AddProviderFactory < TService > ( Func < IServiceProvider , TService > implementationFactory )
5089 where TService : DbProviderFactory
5190 {
@@ -54,6 +93,14 @@ public DataConfigurationBuilder AddProviderFactory<TService>(Func<IServiceProvid
5493 return this ;
5594 }
5695
96+ /// <summary>
97+ /// Adds the provider factory to use with this configuration.
98+ /// </summary>
99+ /// <typeparam name="TService">The type of the service.</typeparam>
100+ /// <returns>
101+ /// The same configuration builder so that multiple calls can be chained.
102+ /// </returns>
103+ /// <seealso cref="DbProviderFactory"/>
57104 public DataConfigurationBuilder AddProviderFactory < TService > ( )
58105 where TService : DbProviderFactory
59106 {
@@ -63,6 +110,15 @@ public DataConfigurationBuilder AddProviderFactory<TService>()
63110 }
64111
65112
113+ /// <summary>
114+ /// Adds the data cache service to use with this configuration.
115+ /// </summary>
116+ /// <typeparam name="TService">The type of the service.</typeparam>
117+ /// <param name="dataCache">The data cache.</param>
118+ /// <returns>
119+ /// The same configuration builder so that multiple calls can be chained.
120+ /// </returns>
121+ /// <seealso cref="IDataCache"/>
66122 public DataConfigurationBuilder AddDataCache < TService > ( TService dataCache )
67123 where TService : class , IDataCache
68124 {
@@ -71,6 +127,15 @@ public DataConfigurationBuilder AddDataCache<TService>(TService dataCache)
71127 return this ;
72128 }
73129
130+ /// <summary>
131+ /// Adds the data cache service to use with this configuration.
132+ /// </summary>
133+ /// <typeparam name="TService">The type of the service.</typeparam>
134+ /// <param name="implementationFactory">The implementation factory.</param>
135+ /// <returns>
136+ /// The same configuration builder so that multiple calls can be chained.
137+ /// </returns>
138+ /// <seealso cref="IDataCache"/>
74139 public DataConfigurationBuilder AddDataCache < TService > ( Func < IServiceProvider , TService > implementationFactory )
75140 where TService : class , IDataCache
76141 {
@@ -79,6 +144,14 @@ public DataConfigurationBuilder AddDataCache<TService>(Func<IServiceProvider, TS
79144 return this ;
80145 }
81146
147+ /// <summary>
148+ /// Adds the data cache service to use with this configuration.
149+ /// </summary>
150+ /// <typeparam name="TService">The type of the service.</typeparam>
151+ /// <returns>
152+ /// The same configuration builder so that multiple calls can be chained.
153+ /// </returns>
154+ /// <seealso cref="IDataCache"/>
82155 public DataConfigurationBuilder AddDataCache < TService > ( )
83156 where TService : class , IDataCache
84157 {
@@ -88,6 +161,15 @@ public DataConfigurationBuilder AddDataCache<TService>()
88161 }
89162
90163
164+ /// <summary>
165+ /// Adds the query generator service to use with this configuration.
166+ /// </summary>
167+ /// <typeparam name="TService">The type of the service.</typeparam>
168+ /// <param name="queryGenerator">The query generator.</param>
169+ /// <returns>
170+ /// The same configuration builder so that multiple calls can be chained.
171+ /// </returns>
172+ /// <seealso cref="IQueryGenerator"/>
91173 public DataConfigurationBuilder AddQueryGenerator < TService > ( TService queryGenerator )
92174 where TService : class , IQueryGenerator
93175 {
@@ -96,6 +178,14 @@ public DataConfigurationBuilder AddQueryGenerator<TService>(TService queryGenera
96178 return this ;
97179 }
98180
181+ /// <summary>
182+ /// Adds the query generator service to use with this configuration.
183+ /// </summary>
184+ /// <typeparam name="TService">The type of the service.</typeparam>
185+ /// <returns>
186+ /// The same configuration builder so that multiple calls can be chained.
187+ /// </returns>
188+ /// <seealso cref="IQueryGenerator"/>
99189 public DataConfigurationBuilder AddQueryGenerator < TService > ( )
100190 where TService : class , IQueryGenerator
101191 {
@@ -104,6 +194,15 @@ public DataConfigurationBuilder AddQueryGenerator<TService>()
104194 return this ;
105195 }
106196
197+ /// <summary>
198+ /// Adds the query generator service to use with this configuration.
199+ /// </summary>
200+ /// <typeparam name="TService">The type of the service.</typeparam>
201+ /// <param name="implementationFactory">The implementation factory.</param>
202+ /// <returns>
203+ /// The same configuration builder so that multiple calls can be chained.
204+ /// </returns>
205+ /// <seealso cref="IQueryGenerator"/>
107206 public DataConfigurationBuilder AddQueryGenerator < TService > ( Func < IServiceProvider , TService > implementationFactory )
108207 where TService : class , IQueryGenerator
109208 {
@@ -112,25 +211,52 @@ public DataConfigurationBuilder AddQueryGenerator<TService>(Func<IServiceProvide
112211 return this ;
113212 }
114213
214+ /// <summary>
215+ /// Adds the SQL server generator to use with this configuration.
216+ /// </summary>
217+ /// <returns>
218+ /// The same configuration builder so that multiple calls can be chained.
219+ /// </returns>
115220 public DataConfigurationBuilder AddSqlServerGenerator ( )
116221 {
117222 AddQueryGenerator < SqlServerGenerator > ( ) ;
118223 return this ;
119224 }
120225
226+ /// <summary>
227+ /// Adds the sqlite generator to use with this configuration.
228+ /// </summary>
229+ /// <returns>
230+ /// The same configuration builder so that multiple calls can be chained.
231+ /// </returns>
121232 public DataConfigurationBuilder AddSqliteGenerator ( )
122233 {
123234 AddQueryGenerator < SqliteGenerator > ( ) ;
124235 return this ;
125236 }
126237
238+ /// <summary>
239+ /// Adds the PostgreSQL generator to use with this configuration.
240+ /// </summary>
241+ /// <returns>
242+ /// The same configuration builder so that multiple calls can be chained.
243+ /// </returns>
127244 public DataConfigurationBuilder AddPostgreSqlGenerator ( )
128245 {
129246 AddQueryGenerator < PostgreSqlGenerator > ( ) ;
130247 return this ;
131248 }
132249
133250
251+ /// <summary>
252+ /// Adds the query logger service to use with this configuration.
253+ /// </summary>
254+ /// <typeparam name="TService">The type of the service.</typeparam>
255+ /// <param name="queryLogger">The query logger.</param>
256+ /// <returns>
257+ /// The same configuration builder so that multiple calls can be chained.
258+ /// </returns>
259+ /// <seealso cref="IDataQueryLogger"/>
134260 public DataConfigurationBuilder AddQueryLogger < TService > ( TService queryLogger )
135261 where TService : class , IDataQueryLogger
136262 {
@@ -139,6 +265,14 @@ public DataConfigurationBuilder AddQueryLogger<TService>(TService queryLogger)
139265 return this ;
140266 }
141267
268+ /// <summary>
269+ /// Adds the query logger service to use with this configuration.
270+ /// </summary>
271+ /// <typeparam name="TService">The type of the service.</typeparam>
272+ /// <returns>
273+ /// The same configuration builder so that multiple calls can be chained.
274+ /// </returns>
275+ /// <seealso cref="IDataQueryLogger"/>
142276 public DataConfigurationBuilder AddQueryLogger < TService > ( )
143277 where TService : class , IDataQueryLogger
144278 {
@@ -147,6 +281,15 @@ public DataConfigurationBuilder AddQueryLogger<TService>()
147281 return this ;
148282 }
149283
284+ /// <summary>
285+ /// Adds the query logger service to use with this configuration.
286+ /// </summary>
287+ /// <typeparam name="TService">The type of the service.</typeparam>
288+ /// <param name="implementationFactory">The implementation factory.</param>
289+ /// <returns>
290+ /// The same configuration builder so that multiple calls can be chained.
291+ /// </returns>
292+ /// <seealso cref="IDataQueryLogger"/>
150293 public DataConfigurationBuilder AddQueryLogger < TService > ( Func < IServiceProvider , TService > implementationFactory )
151294 where TService : class , IDataQueryLogger
152295 {
@@ -156,6 +299,13 @@ public DataConfigurationBuilder AddQueryLogger<TService>(Func<IServiceProvider,
156299 }
157300
158301
302+ /// <summary>
303+ /// Adds services via the configuration setup action.
304+ /// </summary>
305+ /// <param name="setupAction">The configuration setup action.</param>
306+ /// <returns>
307+ /// The same configuration builder so that multiple calls can be chained.
308+ /// </returns>
159309 public DataConfigurationBuilder AddService ( Action < IServiceCollection > setupAction )
160310 {
161311 setupAction ( _services ) ;
0 commit comments