@@ -112,23 +112,15 @@ public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IS
112
112
return services ;
113
113
}
114
114
115
- public static IServiceCollection AddDbContextTransactionMethods < TDbContext > ( this IServiceCollection services ) where TDbContext : DbContext
116
- {
117
- services . AddScoped < DbContext , TDbContext > ( ) ;
118
- services . AddScoped ( typeof ( ITUnitOfWork < , > ) , typeof ( TUnitOfWork < , > ) ) ;
119
- services . AddScoped ( typeof ( IRepository < , > ) , typeof ( Repository < , > ) ) ;
115
+ // public static IServiceCollection AddDbContextTransactionMethods<TDbContext>(this IServiceCollection services) where TDbContext : DbContext
116
+ // {
117
+ // services.AddScoped<DbContext, TDbContext>();
118
+ // services.AddScoped(typeof(ITUnitOfWork<,>), typeof(TUnitOfWork<,>));
119
+ // services.AddScoped(typeof(IRepository<,>), typeof(Repository<,>));
120
120
121
- return services ;
122
- }
121
+ // return services;
122
+ // }
123
123
124
- /// <summary>
125
- /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider MySQL / MariaDB
126
- /// </summary>
127
- /// <typeparam name="TDbContext"></typeparam>
128
- /// <param name="services"></param>
129
- /// <param name="connectionString"></param>
130
- /// <param name="retryOnFailure"></param>
131
- /// <returns></returns>
132
124
public static IServiceCollection AddDbContextUseMySql < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
133
125
{
134
126
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -150,14 +142,6 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
150
142
return services ;
151
143
}
152
144
153
- /// <summary>
154
- /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider Postgres
155
- /// </summary>
156
- /// <typeparam name="TDbContext"></typeparam>
157
- /// <param name="services"></param>
158
- /// <param name="connectionString"></param>
159
- /// <param name="retryOnFailure"></param>
160
- /// <returns></returns>
161
145
public static IServiceCollection AddDbContextUsePostgres < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
162
146
{
163
147
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -180,14 +164,6 @@ public static IServiceCollection AddDbContextUsePostgres<TDbContext>(this IServi
180
164
return services ;
181
165
}
182
166
183
- /// <summary>
184
- /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider SQL Server
185
- /// </summary>
186
- /// <typeparam name="TDbContext"></typeparam>
187
- /// <param name="services"></param>
188
- /// <param name="connectionString"></param>
189
- /// <param name="retryOnFailure"></param>
190
- /// <returns></returns>
191
167
public static IServiceCollection AddDbContextUseSQLServer < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
192
168
{
193
169
services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -214,13 +190,6 @@ public static IServiceCollection AddDbContextUseSQLServer<TDbContext>(this IServ
214
190
return services ;
215
191
}
216
192
217
- /// <summary>
218
- /// Extension method per aggiungere un DbContext di tipo TDbContext con il provider SQLite
219
- /// </summary>
220
- /// <typeparam name="TDbContext"></typeparam>
221
- /// <param name="services"></param>
222
- /// <param name="connectionString"></param>
223
- /// <returns></returns>
224
193
public static IServiceCollection AddDbContextUseSQLite < TDbContext > ( this IServiceCollection services , string connectionString ) where TDbContext : DbContext
225
194
{
226
195
services . AddDbContextPool < TDbContext > ( optionsBuilder =>
@@ -361,7 +330,8 @@ public static IServiceCollection AddHealthChecksSQLite<TDbContext>(this IService
361
330
services . AddHealthChecksUI ( setupSettings : setup =>
362
331
{
363
332
setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
364
- } ) . AddInMemoryStorage ( ) ;
333
+ } )
334
+ . AddInMemoryStorage ( ) ;
365
335
366
336
return services ;
367
337
}
@@ -376,7 +346,8 @@ public static IServiceCollection AddHealthChecksSQLServer<TDbContext>(this IServ
376
346
services . AddHealthChecksUI ( setupSettings : setup =>
377
347
{
378
348
setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
379
- } ) . AddInMemoryStorage ( ) ;
349
+ } )
350
+ . AddInMemoryStorage ( ) ;
380
351
381
352
return services ;
382
353
}
@@ -391,7 +362,8 @@ public static IServiceCollection AddHealthChecksMySQL<TDbContext>(this IServiceC
391
362
services . AddHealthChecksUI ( setupSettings : setup =>
392
363
{
393
364
setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
394
- } ) . AddInMemoryStorage ( ) ;
365
+ } )
366
+ . AddInMemoryStorage ( ) ;
395
367
396
368
return services ;
397
369
}
@@ -406,7 +378,8 @@ public static IServiceCollection AddHealthChecksPostgreSQL<TDbContext>(this ISer
406
378
services . AddHealthChecksUI ( setupSettings : setup =>
407
379
{
408
380
setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
409
- } ) . AddInMemoryStorage ( ) ;
381
+ } )
382
+ . AddInMemoryStorage ( ) ;
410
383
411
384
return services ;
412
385
}
0 commit comments