From 48c8818ecb89997f4c9189f34279f496ae7ce714 Mon Sep 17 00:00:00 2001 From: Marco Minerva Date: Thu, 26 Sep 2024 09:54:41 +0200 Subject: [PATCH] Ensure ProblemDetails service is registered Modified the AddDefaultExceptionHandler method in the ServiceCollectionExtensions class to include the registration of the ProblemDetails service by adding services.AddProblemDetails(). --- .../Extensions/ServiceCollectionExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TinyHelpers.AspNetCore/Extensions/ServiceCollectionExtensions.cs b/src/TinyHelpers.AspNetCore/Extensions/ServiceCollectionExtensions.cs index 784e532..cf26c00 100644 --- a/src/TinyHelpers.AspNetCore/Extensions/ServiceCollectionExtensions.cs +++ b/src/TinyHelpers.AspNetCore/Extensions/ServiceCollectionExtensions.cs @@ -84,6 +84,9 @@ public static IServiceCollection AddDefaultProblemDetails(this IServiceCollectio #if NET8_0_OR_GREATER public static IServiceCollection AddDefaultExceptionHandler(this IServiceCollection services) { + // Ensures that the ProblemDetails service is registered. + services.AddProblemDetails(); + services.AddExceptionHandler(); return services; }