Add dependency injection for global exception handler

Introduce methods in DependencyInjection.cs for configuring
and using a global exception handler. Update the project file
to include a reference to Microsoft.Extensions.Options.
Modify GlobalExceptionHandlerMiddleware to accept
IOptions<GlobalExceptionHandlerOptions> for enhanced
configuration through dependency injection.
This commit is contained in:
Developer 02
2025-05-19 14:38:49 +02:00
parent cb7b69a0a2
commit 97695fb0b0
3 changed files with 17 additions and 2 deletions

View File

@@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.Core.Exceptions\DigitalData.Core.Exceptions.csproj" />
</ItemGroup>