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<IMapperConfigurationExpression> + 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
This commit is contained in:
@@ -9,7 +9,7 @@ namespace DocumentOperator.Application;
|
|||||||
public static class DependencyInjection
|
public static class DependencyInjection
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers Application Layer services (MediatR, FluentValidation, Behaviors)
|
/// Registers Application Layer services (MediatR, FluentValidation, AutoMapper, Behaviors)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IServiceCollection AddApplication(this IServiceCollection services)
|
public static IServiceCollection AddApplication(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
@@ -28,6 +28,9 @@ public static class DependencyInjection
|
|||||||
// Register FluentValidation (scannt Assembly nach Validators)
|
// Register FluentValidation (scannt Assembly nach Validators)
|
||||||
services.AddValidatorsFromAssembly(assembly);
|
services.AddValidatorsFromAssembly(assembly);
|
||||||
|
|
||||||
|
// Register AutoMapper (scannt Assembly nach Profiles)
|
||||||
|
services.AddAutoMapper(cfg => { }, typeof(Common.Mapping.MappingProfile));
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper" Version="16.2.0" />
|
||||||
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
|
||||||
<PackageReference Include="MediatR" Version="14.1.0" />
|
<PackageReference Include="MediatR" Version="14.1.0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user