@@ -99,7 +99,7 @@ public static IServiceCollection AddDateTimeOnlyAttributes(this IServiceCollecti
99
99
}
100
100
#endregion
101
101
102
- #region "DB Context "
102
+ #region "DB CONTEXT EFCORE "
103
103
[ Obsolete ( "This method will be deprecated in future releases." , false ) ]
104
104
public static IServiceCollection AddDbContextGenericsMethods < TDbContext > ( this IServiceCollection services ) where TDbContext : DbContext
105
105
{
@@ -322,95 +322,95 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
322
322
}
323
323
#endregion
324
324
325
- #region "HEALTH CHECKS WITH UI"
326
- public static IServiceCollection AddHealthChecksSQLite < TDbContext > ( this IServiceCollection services , string webAddressGroup , string webAddressTitle , string sqliteConnString ) where TDbContext : DbContext
327
- {
328
- services . AddHealthChecks ( )
329
- . AddDbContextCheck < TDbContext > ( name : "Application DB Context" , failureStatus : HealthStatus . Degraded )
330
- . AddUrlGroup ( new Uri ( webAddressGroup ) , name : webAddressTitle , failureStatus : HealthStatus . Degraded )
331
- . AddSqlite ( sqliteConnString ) ;
332
-
333
- services . AddHealthChecksUI ( setupSettings : setup =>
334
- {
335
- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
336
- } )
337
- . AddInMemoryStorage ( ) ;
338
-
339
- return services ;
340
- }
325
+ //#region "HEALTH CHECKS WITH UI"
326
+ //public static IServiceCollection AddHealthChecksSQLite<TDbContext>(this IServiceCollection services, string webAddressGroup, string webAddressTitle, string sqliteConnString) where TDbContext : DbContext
327
+ //{
328
+ // services.AddHealthChecks()
329
+ // .AddDbContextCheck<TDbContext>(name: "Application DB Context", failureStatus: HealthStatus.Degraded)
330
+ // .AddUrlGroup(new Uri(webAddressGroup), name: webAddressTitle, failureStatus: HealthStatus.Degraded)
331
+ // .AddSqlite(sqliteConnString);
341
332
342
- public static IServiceCollection AddHealthChecksSQLServer < TDbContext > ( this IServiceCollection services , string webAddressGroup , string webAddressTitle , string sqliteConnString ) where TDbContext : DbContext
343
- {
344
- services . AddHealthChecks ( )
345
- . AddDbContextCheck < TDbContext > ( name : "Application DB Context" , failureStatus : HealthStatus . Degraded )
346
- . AddUrlGroup ( new Uri ( webAddressGroup ) , name : webAddressTitle , failureStatus : HealthStatus . Degraded )
347
- . AddSqlServer ( sqliteConnString ) ;
333
+ // services.AddHealthChecksUI(setupSettings: setup =>
334
+ // {
335
+ // setup.AddHealthCheckEndpoint("Health Check", $"/healthz");
336
+ // })
337
+ // .AddInMemoryStorage();
348
338
349
- services . AddHealthChecksUI ( setupSettings : setup =>
350
- {
351
- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
352
- } )
353
- . AddInMemoryStorage ( ) ;
339
+ // return services;
340
+ //}
354
341
355
- return services ;
356
- }
342
+ //public static IServiceCollection AddHealthChecksSQLServer<TDbContext>(this IServiceCollection services, string webAddressGroup, string webAddressTitle, string sqliteConnString) where TDbContext : DbContext
343
+ //{
344
+ // services.AddHealthChecks()
345
+ // .AddDbContextCheck<TDbContext>(name: "Application DB Context", failureStatus: HealthStatus.Degraded)
346
+ // .AddUrlGroup(new Uri(webAddressGroup), name: webAddressTitle, failureStatus: HealthStatus.Degraded)
347
+ // .AddSqlServer(sqliteConnString);
357
348
358
- public static IServiceCollection AddHealthChecksMySQL < TDbContext > ( this IServiceCollection services , string webAddressGroup , string webAddressTitle , string sqliteConnString ) where TDbContext : DbContext
359
- {
360
- services . AddHealthChecks ( )
361
- . AddDbContextCheck < TDbContext > ( name : "Application DB Context" , failureStatus : HealthStatus . Degraded )
362
- . AddUrlGroup ( new Uri ( webAddressGroup ) , name : webAddressTitle , failureStatus : HealthStatus . Degraded )
363
- . AddMySql ( sqliteConnString ) ;
349
+ // services.AddHealthChecksUI(setupSettings: setup =>
350
+ // {
351
+ // setup.AddHealthCheckEndpoint("Health Check", $"/healthz");
352
+ // })
353
+ // .AddInMemoryStorage();
364
354
365
- services . AddHealthChecksUI ( setupSettings : setup =>
366
- {
367
- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
368
- } )
369
- . AddInMemoryStorage ( ) ;
355
+ // return services;
356
+ //}
370
357
371
- return services ;
372
- }
358
+ //public static IServiceCollection AddHealthChecksMySQL<TDbContext>(this IServiceCollection services, string webAddressGroup, string webAddressTitle, string sqliteConnString) where TDbContext : DbContext
359
+ //{
360
+ // services.AddHealthChecks()
361
+ // .AddDbContextCheck<TDbContext>(name: "Application DB Context", failureStatus: HealthStatus.Degraded)
362
+ // .AddUrlGroup(new Uri(webAddressGroup), name: webAddressTitle, failureStatus: HealthStatus.Degraded)
363
+ // .AddMySql(sqliteConnString);
373
364
374
- public static IServiceCollection AddHealthChecksPostgreSQL < TDbContext > ( this IServiceCollection services , string webAddressGroup , string webAddressTitle , string sqliteConnString ) where TDbContext : DbContext
375
- {
376
- services . AddHealthChecks ( )
377
- . AddDbContextCheck < TDbContext > ( name : "Application DB Context" , failureStatus : HealthStatus . Degraded )
378
- . AddUrlGroup ( new Uri ( webAddressGroup ) , name : webAddressTitle , failureStatus : HealthStatus . Degraded )
379
- . AddNpgSql ( sqliteConnString ) ;
365
+ // services.AddHealthChecksUI(setupSettings: setup =>
366
+ // {
367
+ // setup.AddHealthCheckEndpoint("Health Check", $"/healthz");
368
+ // })
369
+ // .AddInMemoryStorage();
380
370
381
- services . AddHealthChecksUI ( setupSettings : setup =>
382
- {
383
- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
384
- } )
385
- . AddInMemoryStorage ( ) ;
371
+ // return services;
372
+ //}
386
373
387
- return services ;
388
- }
374
+ //public static IServiceCollection AddHealthChecksPostgreSQL<TDbContext>(this IServiceCollection services, string webAddressGroup, string webAddressTitle, string sqliteConnString) where TDbContext : DbContext
375
+ //{
376
+ // services.AddHealthChecks()
377
+ // .AddDbContextCheck<TDbContext>(name: "Application DB Context", failureStatus: HealthStatus.Degraded)
378
+ // .AddUrlGroup(new Uri(webAddressGroup), name: webAddressTitle, failureStatus: HealthStatus.Degraded)
379
+ // .AddNpgSql(sqliteConnString);
389
380
390
- public static WebApplication UseHealthChecksConfigure ( this WebApplication app )
391
- {
392
- app . UseHealthChecks ( "/healthz" , new HealthCheckOptions
393
- {
394
- Predicate = _ => true ,
395
- ResponseWriter = UIResponseWriter . WriteHealthCheckUIResponse ,
396
- ResultStatusCodes =
397
- {
398
- [ HealthStatus . Healthy ] = StatusCodes . Status200OK ,
399
- [ HealthStatus . Degraded ] = StatusCodes . Status500InternalServerError ,
400
- [ HealthStatus . Unhealthy ] = StatusCodes . Status503ServiceUnavailable ,
401
- } ,
402
- } ) . UseHealthChecksUI ( setup =>
403
- {
404
- setup . ApiPath = "/healthcheck" ;
405
- setup . UIPath = "/healthcheck-ui" ;
381
+ // services.AddHealthChecksUI(setupSettings: setup =>
382
+ // {
383
+ // setup.AddHealthCheckEndpoint("Health Check", $"/healthz");
384
+ // })
385
+ // .AddInMemoryStorage();
406
386
407
- //https://github.com/Amitpnk/Onion-architecture-ASP.NET-Core/blob/develop/src/OA/Customization/custom.css
408
- //setup.AddCustomStylesheet("Customization/custom.css");
409
- } ) ;
387
+ // return services;
388
+ //}
410
389
411
- return app ;
412
- }
413
- #endregion
390
+ //public static WebApplication UseHealthChecksConfigure(this WebApplication app)
391
+ //{
392
+ // app.UseHealthChecks("/healthz", new HealthCheckOptions
393
+ // {
394
+ // Predicate = _ => true,
395
+ // ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse,
396
+ // ResultStatusCodes =
397
+ // {
398
+ // [HealthStatus.Healthy] = StatusCodes.Status200OK,
399
+ // [HealthStatus.Degraded] = StatusCodes.Status500InternalServerError,
400
+ // [HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable,
401
+ // },
402
+ // }).UseHealthChecksUI(setup =>
403
+ // {
404
+ // setup.ApiPath = "/healthcheck";
405
+ // setup.UIPath = "/healthcheck-ui";
406
+
407
+ // //https://github.com/Amitpnk/Onion-architecture-ASP.NET-Core/blob/develop/src/OA/Customization/custom.css
408
+ // //setup.AddCustomStylesheet("Customization/custom.css");
409
+ // });
410
+
411
+ // return app;
412
+ //}
413
+ //#endregion
414
414
415
415
#region "SEND EMAIL"
416
416
public static IServiceCollection AddMailKitEmailSenderService ( this IServiceCollection services , IConfiguration configuration )
0 commit comments