diff --git a/build/dependencies.props b/build/dependencies.props
index a30da30215..ce5a629445 100644
--- a/build/dependencies.props
+++ b/build/dependencies.props
@@ -33,6 +33,7 @@
2.2.0
2.2.0
2.2.0
+ 2.2.0
2.2.0
2.2.0
2.2.0
diff --git a/eng/Dependencies.props b/eng/Dependencies.props
index 286c298e36..200354b017 100644
--- a/eng/Dependencies.props
+++ b/eng/Dependencies.props
@@ -14,6 +14,7 @@
+
diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props
index aec24922ce..92c4598018 100644
--- a/eng/ProjectReferences.props
+++ b/eng/ProjectReferences.props
@@ -45,6 +45,8 @@
+
+
diff --git a/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
index a469dc113a..50970c8d86 100644
--- a/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
+++ b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
@@ -12,6 +12,7 @@
aspnetcore;testing
false
true
+ true
false
diff --git a/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj b/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj
index 13a082db5e..f581883ab8 100644
--- a/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj
+++ b/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj
@@ -3,8 +3,6 @@
$(StandardTestTfms)
false
- false
-
Diagnostics.FunctionalTests
diff --git a/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj b/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj
index 3623c34990..5c37cdf8c4 100644
--- a/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj
+++ b/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj
@@ -8,11 +8,11 @@
-
+
-
+
diff --git a/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj
index 9f7630aedb..cdd38cc36e 100644
--- a/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj
+++ b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.0;netcoreapp2.1
+ net461;netcoreapp2.2
diff --git a/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj
index 1bc19e49c5..2c4812c068 100644
--- a/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj
+++ b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.0;netcoreapp2.1
+ net461;netcoreapp2.2
diff --git a/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj
index 7710795716..56d768b5f9 100644
--- a/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj
+++ b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.0;netcoreapp2.1
+ net461;netcoreapp2.2
diff --git a/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj
index 40481fde37..84841ec052 100644
--- a/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj
+++ b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.0;netcoreapp2.1
+ net461;netcoreapp2.2
diff --git a/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj
index 40481fde37..84841ec052 100644
--- a/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj
+++ b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.0;netcoreapp2.1
+ net461;netcoreapp2.2
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs
new file mode 100644
index 0000000000..7fa998f296
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs
@@ -0,0 +1,56 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Diagnostics.HealthChecks
+{
+ internal sealed class DbContextHealthCheck : IHealthCheck where TContext : DbContext
+ {
+ private static readonly Func> DefaultTestQuery = (dbContext, cancellationToken) =>
+ {
+ return dbContext.Database.CanConnectAsync(cancellationToken);
+ };
+
+ private readonly TContext _dbContext;
+ private readonly IOptionsMonitor> _options;
+
+ public DbContextHealthCheck(TContext dbContext, IOptionsMonitor> options)
+ {
+ if (dbContext == null)
+ {
+ throw new ArgumentNullException(nameof(dbContext));
+ }
+
+ if (options == null)
+ {
+ throw new ArgumentNullException(nameof(options));
+ }
+
+ _dbContext = dbContext;
+ _options = options;
+ }
+
+ public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
+ {
+ if (context == null)
+ {
+ throw new ArgumentNullException(nameof(context));
+ }
+
+ var options = _options.Get(context.Registration.Name);
+ var testQuery = options.CustomTestQuery ?? DefaultTestQuery;
+
+ if (await testQuery(_dbContext, cancellationToken))
+ {
+ return HealthCheckResult.Healthy();
+ }
+
+ return HealthCheckResult.Unhealthy();
+ }
+ }
+}
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheckOptions.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheckOptions.cs
new file mode 100644
index 0000000000..7fb330c376
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheckOptions.cs
@@ -0,0 +1,15 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+
+namespace Microsoft.Extensions.Diagnostics.HealthChecks
+{
+ internal sealed class DbContextHealthCheckOptions where TContext : DbContext
+ {
+ public Func> CustomTestQuery { get; set; }
+ }
+}
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/src/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs
new file mode 100644
index 0000000000..bf299bc6b0
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs
@@ -0,0 +1,79 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage;
+using Microsoft.Extensions.Diagnostics.HealthChecks;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class EntityFrameworkCoreHealthChecksBuilderExtensions
+ {
+ ///
+ /// Adds a health check for the specified type.
+ ///
+ /// The type.
+ /// The .
+ ///
+ /// The health check name. Optional. If null the type name of will be used for the name.
+ ///
+ ///
+ /// The that should be reported when the health check fails. Optional. If null then
+ /// the default status of will be reported.
+ ///
+ /// A list of tags that can be used to filter sets of health checks. Optional.
+ ///
+ /// A custom test query that will be executed when the health check executes to test the health of the database
+ /// connection and configurations.
+ ///
+ /// The .
+ ///
+ ///
+ /// The health check implementation added by this method will use the dependency injection container
+ /// to create an instance of .
+ ///
+ ///
+ /// By default the health check implementation will use the method
+ /// to test connectivity to the database. This method requires that the database provider has correctly implemented the
+ /// interface. If the database provide has not implemented this interface
+ /// then the health check will report a failure.
+ ///
+ ///
+ /// Providing a will replace the use of
+ /// to test database connectivity. An implementation of a test query should handle exceptions that can arise due to connectivity failure,
+ /// and should return a pass/fail result. The test query should be be designed to complete in a short and predicatable amount of time.
+ ///
+ ///
+ public static IHealthChecksBuilder AddDbContextCheck(
+ this IHealthChecksBuilder builder,
+ string name = null,
+ HealthStatus? failureStatus = default,
+ IEnumerable tags = default,
+ Func> customTestQuery = default)
+ where TContext : DbContext
+ {
+ if (builder == null)
+ {
+ throw new ArgumentNullException(nameof(builder));
+ }
+
+ if (name == null)
+ {
+ name = typeof(TContext).Name;
+ }
+
+ if (customTestQuery != null)
+ {
+ builder.Services.Configure>(name, options => options.CustomTestQuery = customTestQuery);
+ }
+
+ return builder.AddCheck>(name, failureStatus, tags);
+ }
+ }
+}
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj
new file mode 100644
index 0000000000..6b59175d82
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj
@@ -0,0 +1,20 @@
+
+
+
+
+ Components for performing health checks using EntityFrameworkCore.
+
+ netstandard2.0
+ $(NoWarn);CS1591
+ true
+ diagnostics;healthchecks;entityframeworkcore
+ Microsoft.Extensions.Diagnostics.HealthChecks
+
+
+
+
+
+
+
+
+
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/src/Properties/AssemblyInfo.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..1aa256d83a
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Properties/AssemblyInfo.cs
@@ -0,0 +1,3 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
\ No newline at end of file
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/test/DbContextHealthCheckTest.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DbContextHealthCheckTest.cs
new file mode 100644
index 0000000000..b564a62795
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DbContextHealthCheckTest.cs
@@ -0,0 +1,119 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Diagnostics.HealthChecks;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using Xunit;
+
+namespace Microsoft.Extensions.Diagnostics.HealthChecks
+{
+ public class DbContextHealthCheckTest
+ {
+ // Just testing healthy here since it would be complicated to simulate a failure. All of that logic lives in EF anyway.
+ [Fact]
+ public async Task CheckAsync_DefaultTest_Healthy()
+ {
+ // Arrange
+ var services = CreateServices();
+ using (var scope = services.GetRequiredService().CreateScope())
+ {
+ var registration = Assert.Single(services.GetRequiredService>().Value.Registrations);
+ var check = ActivatorUtilities.CreateInstance>(scope.ServiceProvider);
+
+ // Act
+ var result = await check.CheckHealthAsync(new HealthCheckContext() { Registration = registration, });
+
+ // Assert
+ Assert.Equal(HealthStatus.Healthy, result.Status);
+ }
+ }
+
+ [Fact]
+ public async Task CheckAsync_CustomTest_Healthy()
+ {
+ // Arrange
+ var services = CreateServices(async (c, ct) =>
+ {
+ return 0 < await c.Blogs.CountAsync();
+ });
+
+ using (var scope = services.GetRequiredService().CreateScope())
+ {
+ var registration = Assert.Single(services.GetRequiredService>().Value.Registrations);
+ var check = ActivatorUtilities.CreateInstance>(scope.ServiceProvider);
+
+ // Add a blog so that the custom test passes
+ var context = scope.ServiceProvider.GetRequiredService();
+ context.Add(new Blog());
+ await context.SaveChangesAsync();
+
+ // Act
+ var result = await check.CheckHealthAsync(new HealthCheckContext() { Registration = registration, });
+
+ // Assert
+ Assert.Equal(HealthStatus.Healthy, result.Status);
+ }
+ }
+
+ [Fact]
+ public async Task CheckAsync_CustomTest_Degraded()
+ {
+ // Arrange
+ var services = CreateServices(async (c, ct) =>
+ {
+ return 0 < await c.Blogs.CountAsync();
+ }, failureStatus: HealthStatus.Degraded);
+
+ using (var scope = services.GetRequiredService().CreateScope())
+ {
+ var registration = Assert.Single(services.GetRequiredService>().Value.Registrations);
+ var check = ActivatorUtilities.CreateInstance>(scope.ServiceProvider);
+
+ // Act
+ var result = await check.CheckHealthAsync(new HealthCheckContext() { Registration = registration, });
+
+ // Assert
+ Assert.Equal(HealthStatus.Unhealthy, result.Status);
+ }
+ }
+
+ [Fact]
+ public async Task CheckAsync_CustomTest_Unhealthy()
+ {
+ // Arrange
+ var services = CreateServices(async (c, ct) =>
+ {
+ return 0 < await c.Blogs.CountAsync();
+ }, failureStatus: HealthStatus.Unhealthy);
+
+ using (var scope = services.GetRequiredService().CreateScope())
+ {
+ var registration = Assert.Single(services.GetRequiredService>().Value.Registrations);
+ var check = ActivatorUtilities.CreateInstance>(scope.ServiceProvider);
+
+ // Act
+ var result = await check.CheckHealthAsync(new HealthCheckContext() { Registration = registration, });
+
+ // Assert
+ Assert.Equal(HealthStatus.Unhealthy, result.Status);
+ }
+ }
+
+ private static IServiceProvider CreateServices(
+ Func> testQuery = null,
+ HealthStatus failureStatus = HealthStatus.Unhealthy)
+ {
+ var serviceCollection = new ServiceCollection();
+ serviceCollection.AddDbContext(o => o.UseInMemoryDatabase("Test"));
+
+ var builder = serviceCollection.AddHealthChecks();
+ builder.AddDbContextCheck("test", failureStatus, new[] { "tag1", "tag2", }, testQuery);
+ return serviceCollection.BuildServiceProvider();
+ }
+ }
+}
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/test/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs
new file mode 100644
index 0000000000..9efcb025e0
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs
@@ -0,0 +1,47 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Diagnostics.HealthChecks;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Diagnostics.HealthChecks;
+using Microsoft.Extensions.Options;
+using Xunit;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public class EntityFrameworkCoreHealthChecksBuilderExtensionsTest
+ {
+ [Fact]
+ public void AddDbContextCheck_RegistersDbContextHealthCheck()
+ {
+ // Arrange
+ var serviceCollection = new ServiceCollection();
+ serviceCollection.AddDbContext(o => o.UseInMemoryDatabase("Test"));
+
+ var builder = serviceCollection.AddHealthChecks();
+
+ // Act
+ builder.AddDbContextCheck("test", HealthStatus.Degraded, new[] { "tag1", "tag2", }, (c, ct) => Task.FromResult(true));
+
+ // Assert
+ var services = serviceCollection.BuildServiceProvider();
+
+ var registrations = services.GetRequiredService>().Value.Registrations;
+
+ var registration = Assert.Single(registrations);
+ Assert.Equal("test", registration.Name);
+ Assert.Equal(HealthStatus.Degraded, registration.FailureStatus);
+ Assert.Equal(new[] { "tag1", "tag2", }, registration.Tags.ToArray());
+
+ var options = services.GetRequiredService>>();
+ Assert.NotNull(options.Get("test").CustomTestQuery);
+
+ using (var scope = services.GetRequiredService().CreateScope())
+ {
+ var check = Assert.IsType>(registration.Factory(scope.ServiceProvider));
+ }
+ }
+ }
+}
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj b/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj
new file mode 100644
index 0000000000..0523f91842
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj
@@ -0,0 +1,14 @@
+
+
+
+ $(StandardTestTfms)
+ Microsoft.AspNetCore.Diagnostics.HealthChecks
+
+
+
+
+
+
+
+
+
diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/test/TestDbContext.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/TestDbContext.cs
new file mode 100644
index 0000000000..e38ed93674
--- /dev/null
+++ b/src/Middleware/HealthChecks.EntityFrameworkCore/test/TestDbContext.cs
@@ -0,0 +1,24 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.EntityFrameworkCore;
+
+namespace Microsoft.AspNetCore.Diagnostics.HealthChecks
+{
+ public class TestDbContext : DbContext
+ {
+ public TestDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ public DbSet Blogs { get; set; }
+ }
+
+ public class Blog
+ {
+ public int Id { get; set; }
+
+ public int Name { get; set; }
+ }
+}
diff --git a/src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs b/src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs
new file mode 100644
index 0000000000..6f54f51765
--- /dev/null
+++ b/src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs
@@ -0,0 +1,254 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.AspNetCore.Diagnostics.HealthChecks;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.AspNetCore.Builder
+{
+ ///
+ /// extension methods for the .
+ ///
+ public static class HealthCheckApplicationBuilderExtensions
+ {
+ ///
+ /// Adds a middleware that provides health check status.
+ ///
+ /// The .
+ /// The path on which to provide health check status.
+ /// A reference to the after the operation has completed.
+ ///
+ ///
+ /// If is set to null or the empty string then the health check middleware
+ /// will ignore the URL path and process all requests. If is set to a non-empty
+ /// value, the health check middleware will process requests with a URL that matches the provided value
+ /// of case-insensitively, allowing for an extra trailing slash ('/') character.
+ ///
+ ///
+ /// The health check middleware will use default settings from .
+ ///
+ ///
+ public static IApplicationBuilder UseHealthChecks(this IApplicationBuilder app, PathString path)
+ {
+ if (app == null)
+ {
+ throw new ArgumentNullException(nameof(app));
+ }
+
+ UseHealthChecksCore(app, path, port: null, Array.Empty