From b7e66ab5f9867e6d20c9c5bb306f2e221fc47456 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Tue, 21 Apr 2026 12:01:23 +0200 Subject: [PATCH] Update MediatR and DI packages; refactor registration Upgraded to MediatR 14.1.0 and updated registration to use the new syntax. Removed MediatR.Extensions.Microsoft.DependencyInjection where no longer needed. Bumped Microsoft.Extensions.DependencyInjection.Abstractions to 10.0.0 in Application and Infrastructure projects. --- DbFirst.API/DbFirst.API.csproj | 1 - DbFirst.Application/DbFirst.Application.csproj | 4 ++-- DbFirst.Application/DependencyInjection.cs | 3 ++- DbFirst.Infrastructure/DbFirst.Infrastructure.csproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DbFirst.API/DbFirst.API.csproj b/DbFirst.API/DbFirst.API.csproj index 0cd3dea..82b0695 100644 --- a/DbFirst.API/DbFirst.API.csproj +++ b/DbFirst.API/DbFirst.API.csproj @@ -17,7 +17,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/DbFirst.Application/DbFirst.Application.csproj b/DbFirst.Application/DbFirst.Application.csproj index ec03168..2eabaad 100644 --- a/DbFirst.Application/DbFirst.Application.csproj +++ b/DbFirst.Application/DbFirst.Application.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/DbFirst.Application/DependencyInjection.cs b/DbFirst.Application/DependencyInjection.cs index e02bea1..1256100 100644 --- a/DbFirst.Application/DependencyInjection.cs +++ b/DbFirst.Application/DependencyInjection.cs @@ -8,7 +8,8 @@ public static class DependencyInjection public static IServiceCollection AddApplication(this IServiceCollection services) { services.AddAutoMapper(typeof(DependencyInjection).Assembly); - services.AddMediatR(typeof(DependencyInjection).Assembly); + services.AddMediatR(cfg => + cfg.RegisterServicesFromAssembly(typeof(DependencyInjection).Assembly)); return services; } } diff --git a/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj b/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj index 83b7a53..24f1fe7 100644 --- a/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj +++ b/DbFirst.Infrastructure/DbFirst.Infrastructure.csproj @@ -15,7 +15,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - +