initial commit

This commit is contained in:
2026-07-21 14:08:10 +07:00
commit f7cf118326
533 changed files with 41762 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
namespace Indotalent.ConfigBackEnd;
using FluentValidation;
using Indotalent.ConfigBackEnd.Behaviours;
using MediatR;
using MediatR.Pipeline;
using Microsoft.Extensions.DependencyInjection;
public static class DI
{
public static IServiceCollection AddConfigBackEndDI(this IServiceCollection services)
{
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(typeof(DI).Assembly);
cfg.AddRequestPreProcessor(typeof(IRequestPreProcessor<>), typeof(LoggingBehaviour<>));
cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(UnhandledExceptionBehaviour<,>));
cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(PerformanceBehaviour<,>));
cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(ValidationBehaviour<,>));
cfg.AddBehavior(typeof(IPipelineBehavior<,>), typeof(AuthorizationBehaviour<,>));
cfg.Lifetime = ServiceLifetime.Scoped;
});
services.AddValidatorsFromAssembly(typeof(DI).Assembly);
return services;
}
}