@@ -99,7 +99,7 @@ public static IServiceCollection AddDateTimeOnlyAttributes(this IServiceCollecti
9999 }
100100 #endregion
101101
102- #region "DB Context "
102+ #region "DB CONTEXT EFCORE "
103103 [ Obsolete ( "This method will be deprecated in future releases." , false ) ]
104104 public static IServiceCollection AddDbContextGenericsMethods < TDbContext > ( this IServiceCollection services ) where TDbContext : DbContext
105105 {
@@ -322,95 +322,95 @@ public static IEndpointRouteBuilder AddDatabaseHealthChecks(this IEndpointRouteB
322322 }
323323 #endregion
324324
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);
341332
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();
348338
349- services . AddHealthChecksUI ( setupSettings : setup =>
350- {
351- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
352- } )
353- . AddInMemoryStorage ( ) ;
339+ // return services;
340+ //}
354341
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);
357348
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();
364354
365- services . AddHealthChecksUI ( setupSettings : setup =>
366- {
367- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
368- } )
369- . AddInMemoryStorage ( ) ;
355+ // return services;
356+ //}
370357
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);
373364
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();
380370
381- services . AddHealthChecksUI ( setupSettings : setup =>
382- {
383- setup . AddHealthCheckEndpoint ( "Health Check" , $ "/healthz") ;
384- } )
385- . AddInMemoryStorage ( ) ;
371+ // return services;
372+ //}
386373
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);
389380
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();
406386
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+ //}
410389
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
414414
415415 #region "SEND EMAIL"
416416 public static IServiceCollection AddMailKitEmailSenderService ( this IServiceCollection services , IConfiguration configuration )
0 commit comments