This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1010global using System . Text . Json . Serialization ;
1111global using System . Threading ;
1212global using System . Threading . Tasks ;
13+ global using FluentValidation . Results ;
1314global using MailKit . Net . Smtp ;
1415global using MailKit . Security ;
1516global using MediatR ;
4748global using NET6CustomLibrary . RedisCache . Services ;
4849global using NET6CustomLibrary . Serilog . Models ;
4950global using NET6CustomLibrary . Serilog . Services ;
50- // global using NET6CustomLibrary.Validazione.Interfaces;
51+ global using NET6CustomLibrary . Validazione . Interfaces ;
5152global using Npgsql ;
5253global using RabbitMQ . Client ;
5354global using RabbitMQ . Client . Events ;
Original file line number Diff line number Diff line change 1+ namespace NET6CustomLibrary . Validazione . Interfaces ;
2+
3+ public interface IValidation
4+ {
5+ List < string > ProcessErrorList ( ValidationResult validationResult ) ;
6+ }
Original file line number Diff line number Diff line change 1+ namespace NET6CustomLibrary . Validazione ;
2+
3+ public class Validation : IValidation
4+ {
5+ private readonly ILoggerService logger ;
6+
7+ public Validation ( ILoggerService logger )
8+ {
9+ this . logger = logger ;
10+ }
11+
12+ public List < string > ProcessErrorList ( ValidationResult validationResult )
13+ {
14+ List < string > errorList = new ( ) ;
15+
16+ validationResult . Errors . ForEach ( x => errorList . Add ( x . ErrorMessage ) ) ;
17+ validationResult . Errors . ForEach ( y => logger . SaveLogError ( y . ErrorMessage ) ) ;
18+
19+ return errorList ;
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments