Files
DocumentService/DocumentOperator.Application/DependencyInjection.cs
OlgunR afc0e34312 Complete Step 1.1: ValidatePDF Application Layer
Updated PHASENPLAN and ROADMAP to reflect progress on Feature 1 - ValidatePDF (75% complete). Marked Step 1.1 as completed, including MediatR setup, pipeline behaviors (`ValidationBehavior`, `LoggingBehavior`), ValidatePDF feature (Query, Handler, Validator), and DTOs.

Added `DependencyInjection.cs` for Application Layer DI configuration. Introduced `LoggingBehavior` and `ValidationBehavior` for MediatR pipelines. Implemented `ValidatePdfHandler`, `ValidatePdfQuery`, and `ValidatePdfValidator`.

Created DTOs (`ValidatePdfRequest`, `ValidatePdfResponse`) for the ValidatePDF feature. Added unit tests for `ValidatePdfHandler` to verify metadata handling and exception propagation.

Removed unused folder references in `DocumentOperator.Application.csproj`.
2026-06-25 15:23:58 +02:00

34 lines
1.1 KiB
C#

using FluentValidation;
using Microsoft.Extensions.DependencyInjection;
namespace DocumentOperator.Application;
/// <summary>
/// Dependency Injection configuration for Application Layer
/// </summary>
public static class DependencyInjection
{
/// <summary>
/// Registers Application Layer services (MediatR, FluentValidation, Behaviors)
/// </summary>
public static IServiceCollection AddApplication(this IServiceCollection services)
{
var assembly = typeof(DependencyInjection).Assembly;
// Register MediatR (scannt Assembly nach Handlers)
services.AddMediatR(config =>
{
config.RegisterServicesFromAssembly(assembly);
// Pipeline Behaviors (Reihenfolge wichtig!)
config.AddOpenBehavior(typeof(Common.Behaviors.ValidationBehavior<,>));
config.AddOpenBehavior(typeof(Common.Behaviors.LoggingBehavior<,>));
});
// Register FluentValidation (scannt Assembly nach Validators)
services.AddValidatorsFromAssembly(assembly);
return services;
}
}