Deprecate services in favor of MediatR integration

This commit introduces the `[Obsolete("Use MediatR")]` attribute to various service fields and methods across multiple controllers and extension classes, signaling a transition to MediatR for handling requests and commands.

Key changes include:
- Marking `IEnvelopeService`, `IEnvelopeReceiverService`, and `IEnvelopeTypeService` as obsolete in their respective controllers.
- Updating `AddEnvelopeGeneratorInfrastructureServices` to utilize `IRepository`.
- Refactoring `AddCommandManagerRunner` and `CreateHost` methods to indicate obsolescence.
- Replacing `DigitalData.Core.DTO` with `DigitalData.Core.Abstraction.Application.DTO` in using directives.

These changes modernize the codebase and improve command and query handling while cleaning up service dependencies.
This commit is contained in:
2025-06-30 10:05:36 +02:00
parent e4c6714677
commit 1c90e693da
7 changed files with 37 additions and 11 deletions

View File

@@ -14,6 +14,7 @@ namespace EnvelopeGenerator.Terminal;
public static class DependencyInjection
{
[Obsolete("Use MediatR")]
public static IServiceCollection AddCommandManagerRunner(this IServiceCollection services, IConfiguration configuration, Case @case = Case.KebabCase, string connectionStringKeyName = "Default")
{
var connStr = configuration.GetConnectionString(connectionStringKeyName)
@@ -52,4 +53,4 @@ public static class DependencyInjection
}
public static Task<int> RunCommandManagerRunner(this IHost host, string[] args) => host.Services.RunCommandManagerRunner(args);
}
}