This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree 3 files changed +29
-1
lines changed 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 10
10
global using System . Text . Json . Serialization ;
11
11
global using System . Threading ;
12
12
global using System . Threading . Tasks ;
13
+ global using FluentValidation . Results ;
13
14
global using MailKit . Net . Smtp ;
14
15
global using MailKit . Security ;
15
16
global using MediatR ;
47
48
global using NET6CustomLibrary . RedisCache . Services ;
48
49
global using NET6CustomLibrary . Serilog . Models ;
49
50
global using NET6CustomLibrary . Serilog . Services ;
50
- // global using NET6CustomLibrary.Validazione.Interfaces;
51
+ global using NET6CustomLibrary . Validazione . Interfaces ;
51
52
global using Npgsql ;
52
53
global using RabbitMQ . Client ;
53
54
global 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