From 398651964e1895d3bee34c0127b786dd405ab9b5 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 7 Jul 2026 19:00:29 +0200 Subject: [PATCH] chore: Upgrade AutoMapper to v16.2.0 and fix DI registration - Upgrade AutoMapper from 12.0.1 to 16.2.0 - Remove deprecated AutoMapper.Extensions.Microsoft.DependencyInjection v12.0.1 (deprecated 25 May 2023, DI moved to main package in v13.0+) - Update DI registration: AddAutoMapper(cfg => {}, typeof(MappingProfile)) (v13.0+ requires Action + marker type) Security fix: - Resolves NU1903 vulnerability (GHSA-rvv3-g6hj-g44x DoS in v12.0.1) Result: AutoMapper v16.2.0, 0 security warnings, all tests passing --- DocumentOperator.Application/DependencyInjection.cs | 5 ++++- .../DocumentOperator.Application.csproj | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DocumentOperator.Application/DependencyInjection.cs b/DocumentOperator.Application/DependencyInjection.cs index 7c2e4d7..4addee1 100644 --- a/DocumentOperator.Application/DependencyInjection.cs +++ b/DocumentOperator.Application/DependencyInjection.cs @@ -9,7 +9,7 @@ namespace DocumentOperator.Application; public static class DependencyInjection { /// - /// Registers Application Layer services (MediatR, FluentValidation, Behaviors) + /// Registers Application Layer services (MediatR, FluentValidation, AutoMapper, Behaviors) /// public static IServiceCollection AddApplication(this IServiceCollection services) { @@ -28,6 +28,9 @@ public static class DependencyInjection // Register FluentValidation (scannt Assembly nach Validators) services.AddValidatorsFromAssembly(assembly); + // Register AutoMapper (scannt Assembly nach Profiles) + services.AddAutoMapper(cfg => { }, typeof(Common.Mapping.MappingProfile)); + return services; } } diff --git a/DocumentOperator.Application/DocumentOperator.Application.csproj b/DocumentOperator.Application/DocumentOperator.Application.csproj index 3292426..b86574b 100644 --- a/DocumentOperator.Application/DocumentOperator.Application.csproj +++ b/DocumentOperator.Application/DocumentOperator.Application.csproj @@ -7,6 +7,7 @@ +