21 lines
632 B
C#
21 lines
632 B
C#
|
|
using FluentValidation;
|
||
|
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
|
using SIGCM2.Application.Abstractions;
|
||
|
|
using SIGCM2.Application.Auth.Login;
|
||
|
|
|
||
|
|
namespace SIGCM2.Application;
|
||
|
|
|
||
|
|
public static class DependencyInjection
|
||
|
|
{
|
||
|
|
public static IServiceCollection AddApplication(this IServiceCollection services)
|
||
|
|
{
|
||
|
|
// Register command handlers
|
||
|
|
services.AddScoped<ICommandHandler<LoginCommand, LoginResponseDto>, LoginCommandHandler>();
|
||
|
|
|
||
|
|
// Register FluentValidation validators from this assembly
|
||
|
|
services.AddValidatorsFromAssemblyContaining<LoginCommandValidator>();
|
||
|
|
|
||
|
|
return services;
|
||
|
|
}
|
||
|
|
}
|