@@ -3,75 +3,75 @@ namespace Codehard.Functional.AspNetCore;
3
3
4
4
public static class ValidationExtensions
5
5
{
6
- public static Eff < A > ToAffWithFailToOK < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
6
+ public static Eff < A > ToEffWithFailToOK < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
7
7
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToOK ( _ => errorMessage , errorCode ) ;
8
8
9
- public static Eff < A > ToAffWithFailToOK < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
9
+ public static Eff < A > ToEffWithFailToOK < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
10
10
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToOK ( errorMessageFunc , errorCode ) ;
11
11
12
- public static Eff < A > ToAffWithFailToCreated < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
12
+ public static Eff < A > ToEffWithFailToCreated < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
13
13
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToCreated ( _ => errorMessage , errorCode ) ;
14
14
15
- public static Eff < A > ToAffWithFailToCreated < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
15
+ public static Eff < A > ToEffWithFailToCreated < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
16
16
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToCreated ( errorMessageFunc ) ;
17
17
18
- public static Eff < A > ToAffWithFailToAccepted < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
18
+ public static Eff < A > ToEffWithFailToAccepted < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
19
19
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToAccepted ( _ => errorMessage , errorCode ) ;
20
20
21
- public static Eff < A > ToAffWithFailToAccepted < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
21
+ public static Eff < A > ToEffWithFailToAccepted < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
22
22
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToAccepted ( errorMessageFunc , errorCode ) ;
23
23
24
- public static Eff < A > ToAffWithFailToNoContent < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
24
+ public static Eff < A > ToEffWithFailToNoContent < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
25
25
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToNoContent ( _ => errorMessage , errorCode ) ;
26
26
27
- public static Eff < A > ToAffWithFailToNoContent < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
27
+ public static Eff < A > ToEffWithFailToNoContent < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
28
28
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToNoContent ( errorMessageFunc , errorCode ) ;
29
29
30
- public static Eff < A > ToAffWithFailToBadRequest < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
30
+ public static Eff < A > ToEffWithFailToBadRequest < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
31
31
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToBadRequest ( _ => errorMessage , errorCode ) ;
32
32
33
- public static Eff < A > ToAffWithFailToBadRequest < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
33
+ public static Eff < A > ToEffWithFailToBadRequest < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
34
34
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToBadRequest ( errorMessageFunc , errorCode ) ;
35
35
36
- public static Eff < A > ToAffWithFailToUnauthorized < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
36
+ public static Eff < A > ToEffWithFailToUnauthorized < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
37
37
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToUnauthorized ( _ => errorMessage , errorCode ) ;
38
38
39
- public static Eff < A > ToAffWithFailToUnauthorized < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
39
+ public static Eff < A > ToEffWithFailToUnauthorized < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
40
40
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToUnauthorized ( errorMessageFunc , errorCode ) ;
41
41
42
- public static Eff < A > ToAffWithFailToForbidden < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
42
+ public static Eff < A > ToEffWithFailToForbidden < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
43
43
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToForbidden ( _ => errorMessage , errorCode ) ;
44
44
45
- public static Eff < A > ToAffWithFailToForbidden < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
45
+ public static Eff < A > ToEffWithFailToForbidden < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
46
46
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToForbidden ( errorMessageFunc , errorCode ) ;
47
47
48
- public static Eff < A > ToAffWithFailToNotFound < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
48
+ public static Eff < A > ToEffWithFailToNotFound < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
49
49
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToNotFound ( _ => errorMessage , errorCode ) ;
50
50
51
- public static Eff < A > ToAffWithFailToNotFound < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
51
+ public static Eff < A > ToEffWithFailToNotFound < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
52
52
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToNotFound ( errorMessageFunc , errorCode ) ;
53
53
54
- public static Eff < A > ToAffWithFailToConflict < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
54
+ public static Eff < A > ToEffWithFailToConflict < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
55
55
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToConflict ( _ => errorMessage , errorCode ) ;
56
56
57
- public static Eff < A > ToAffWithFailToConflict < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
57
+ public static Eff < A > ToEffWithFailToConflict < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
58
58
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToConflict ( errorMessageFunc , errorCode ) ;
59
59
60
- public static Eff < A > ToAffWithFailToUnprocessableEntity < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
60
+ public static Eff < A > ToEffWithFailToUnprocessableEntity < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
61
61
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToUnprocessableEntity ( _ => errorMessage , errorCode ) ;
62
62
63
- public static Eff < A > ToAffWithFailToUnprocessableEntity < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
63
+ public static Eff < A > ToEffWithFailToUnprocessableEntity < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
64
64
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToUnprocessableEntity ( errorMessageFunc , errorCode ) ;
65
65
66
- public static Eff < A > ToAffWithFailToLocked < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
66
+ public static Eff < A > ToEffWithFailToLocked < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
67
67
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToLocked ( _ => errorMessage , errorCode ) ;
68
68
69
- public static Eff < A > ToAffWithFailToLocked < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
69
+ public static Eff < A > ToEffWithFailToLocked < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
70
70
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToLocked ( errorMessageFunc , errorCode ) ;
71
71
72
- public static Eff < A > ToAffWithFailToInternalServerError < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
72
+ public static Eff < A > ToEffWithFailToInternalServerError < A > ( this Validation < Error , A > ma , string errorCode , string errorMessage = "" )
73
73
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToInternalServerError ( _ => errorMessage , errorCode ) ;
74
74
75
- public static Eff < A > ToAffWithFailToInternalServerError < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
75
+ public static Eff < A > ToEffWithFailToInternalServerError < A > ( this Validation < Error , A > ma , string errorCode , Func < Error , string > errorMessageFunc )
76
76
=> liftEff ( ( ) => ma . ToEither ( ) ) . MapFailToInternalServerError ( errorMessageFunc , errorCode ) ;
77
77
}
0 commit comments