@@ -112,23 +112,15 @@ public static IServiceCollection AddDbContextGenericsMethods<TDbContext>(this IS
112112 return services ;
113113 }
114114
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<,>));
120120
121- return services ;
122- }
121+ // return services;
122+ // }
123123
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>
132124 public static IServiceCollection AddDbContextUseMySql < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
133125 {
134126 services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -150,14 +142,6 @@ public static IServiceCollection AddDbContextUseMySql<TDbContext>(this IServiceC
150142 return services ;
151143 }
152144
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>
161145 public static IServiceCollection AddDbContextUsePostgres < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
162146 {
163147 services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -180,14 +164,6 @@ public static IServiceCollection AddDbContextUsePostgres<TDbContext>(this IServi
180164 return services ;
181165 }
182166
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>
191167 public static IServiceCollection AddDbContextUseSQLServer < TDbContext > ( this IServiceCollection services , string connectionString , int retryOnFailure ) where TDbContext : DbContext
192168 {
193169 services . AddDbContextPool < TDbContext > ( optionBuilder =>
@@ -214,13 +190,6 @@ public static IServiceCollection AddDbContextUseSQLServer<TDbContext>(this IServ
214190 return services ;
215191 }
216192
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>
224193 public static IServiceCollection AddDbContextUseSQLite < TDbContext > ( this IServiceCollection services , string connectionString ) where TDbContext : DbContext
225194 {
226195 services . AddDbContextPool < TDbContext > ( optionsBuilder =>
@@ -361,7 +330,8 @@ public static IServiceCollection AddHealthChecksSQLite<TDbContext>(this IService
361330 services . AddHealthChecksUI ( setupSettings : setup =>
362331 {
363332 setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
364- } ) . AddInMemoryStorage ( ) ;
333+ } )
334+ . AddInMemoryStorage ( ) ;
365335
366336 return services ;
367337 }
@@ -376,7 +346,8 @@ public static IServiceCollection AddHealthChecksSQLServer<TDbContext>(this IServ
376346 services . AddHealthChecksUI ( setupSettings : setup =>
377347 {
378348 setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
379- } ) . AddInMemoryStorage ( ) ;
349+ } )
350+ . AddInMemoryStorage ( ) ;
380351
381352 return services ;
382353 }
@@ -391,7 +362,8 @@ public static IServiceCollection AddHealthChecksMySQL<TDbContext>(this IServiceC
391362 services . AddHealthChecksUI ( setupSettings : setup =>
392363 {
393364 setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
394- } ) . AddInMemoryStorage ( ) ;
365+ } )
366+ . AddInMemoryStorage ( ) ;
395367
396368 return services ;
397369 }
@@ -406,7 +378,8 @@ public static IServiceCollection AddHealthChecksPostgreSQL<TDbContext>(this ISer
406378 services . AddHealthChecksUI ( setupSettings : setup =>
407379 {
408380 setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
409- } ) . AddInMemoryStorage ( ) ;
381+ } )
382+ . AddInMemoryStorage ( ) ;
410383
411384 return services ;
412385 }
0 commit comments