Skip to content

Commit 394f925

Browse files
committed
Restore docs
1 parent 1639211 commit 394f925

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CSharpFunctionalExtensions/Result/Methods/Extensions/MapError.ValueTask.Right.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ namespace CSharpFunctionalExtensions.ValueTasks
66
{
77
public static partial class ResultExtensions
88
{
9+
/// <summary>
10+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
11+
/// </summary>
912
public static async ValueTask<Result> MapError(
1013
this Result result,
1114
Func<string, ValueTask<string>> errorFactory
@@ -20,6 +23,9 @@ Func<string, ValueTask<string>> errorFactory
2023
return Result.Failure(error);
2124
}
2225

26+
/// <summary>
27+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
28+
/// </summary>
2329
public static async ValueTask<Result> MapError<TContext>(
2430
this Result result,
2531
Func<string, TContext, ValueTask<string>> errorFactory,
@@ -35,6 +41,9 @@ TContext context
3541
return Result.Failure(error);
3642
}
3743

44+
/// <summary>
45+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
46+
/// </summary>
3847
public static async ValueTask<UnitResult<E>> MapError<E>(
3948
this Result result,
4049
Func<string, ValueTask<E>> errorFactory
@@ -49,6 +58,9 @@ Func<string, ValueTask<E>> errorFactory
4958
return UnitResult.Failure(error);
5059
}
5160

61+
/// <summary>
62+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
63+
/// </summary>
5264
public static async ValueTask<UnitResult<E>> MapError<E, TContext>(
5365
this Result result,
5466
Func<string, TContext, ValueTask<E>> errorFactory,
@@ -64,6 +76,9 @@ TContext context
6476
return UnitResult.Failure(error);
6577
}
6678

79+
/// <summary>
80+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
81+
/// </summary>
6782
public static async ValueTask<Result<T>> MapError<T>(
6883
this Result<T> result,
6984
Func<string, ValueTask<string>> errorFactory
@@ -78,6 +93,9 @@ Func<string, ValueTask<string>> errorFactory
7893
return Result.Failure<T>(error);
7994
}
8095

96+
/// <summary>
97+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
98+
/// </summary>
8199
public static async ValueTask<Result<T>> MapError<T, TContext>(
82100
this Result<T> result,
83101
Func<string, TContext, ValueTask<string>> errorFactory,
@@ -93,6 +111,9 @@ TContext context
93111
return Result.Failure<T>(error);
94112
}
95113

114+
/// <summary>
115+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
116+
/// </summary>
96117
public static async ValueTask<Result<T, E>> MapError<T, E>(
97118
this Result<T> result,
98119
Func<string, ValueTask<E>> errorFactory
@@ -107,6 +128,9 @@ Func<string, ValueTask<E>> errorFactory
107128
return Result.Failure<T, E>(error);
108129
}
109130

131+
/// <summary>
132+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
133+
/// </summary>
110134
public static async ValueTask<Result<T, E>> MapError<T, E, TContext>(
111135
this Result<T> result,
112136
Func<string, TContext, ValueTask<E>> errorFactory,
@@ -122,6 +146,9 @@ TContext context
122146
return Result.Failure<T, E>(error);
123147
}
124148

149+
/// <summary>
150+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
151+
/// </summary>
125152
public static async ValueTask<Result> MapError<E>(
126153
this UnitResult<E> result,
127154
Func<E, ValueTask<string>> errorFactory
@@ -136,6 +163,9 @@ Func<E, ValueTask<string>> errorFactory
136163
return Result.Failure(error);
137164
}
138165

166+
/// <summary>
167+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
168+
/// </summary>
139169
public static async ValueTask<Result> MapError<E, TContext>(
140170
this UnitResult<E> result,
141171
Func<E, TContext, ValueTask<string>> errorFactory,
@@ -151,6 +181,9 @@ TContext context
151181
return Result.Failure(error);
152182
}
153183

184+
/// <summary>
185+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
186+
/// </summary>
154187
public static async ValueTask<UnitResult<E2>> MapError<E, E2>(
155188
this UnitResult<E> result,
156189
Func<E, ValueTask<E2>> errorFactory
@@ -165,6 +198,9 @@ Func<E, ValueTask<E2>> errorFactory
165198
return UnitResult.Failure(error);
166199
}
167200

201+
/// <summary>
202+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
203+
/// </summary>
168204
public static async ValueTask<UnitResult<E2>> MapError<E, E2, TContext>(
169205
this UnitResult<E> result,
170206
Func<E, TContext, ValueTask<E2>> errorFactory,
@@ -180,6 +216,9 @@ TContext context
180216
return UnitResult.Failure(error);
181217
}
182218

219+
/// <summary>
220+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
221+
/// </summary>
183222
public static async ValueTask<Result<T>> MapError<T, E>(
184223
this Result<T, E> result,
185224
Func<E, ValueTask<string>> errorFactory
@@ -194,6 +233,9 @@ Func<E, ValueTask<string>> errorFactory
194233
return Result.Failure<T>(error);
195234
}
196235

236+
/// <summary>
237+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
238+
/// </summary>
197239
public static async ValueTask<Result<T>> MapError<T, E, TContext>(
198240
this Result<T, E> result,
199241
Func<E, TContext, ValueTask<string>> errorFactory,
@@ -209,6 +251,9 @@ TContext context
209251
return Result.Failure<T>(error);
210252
}
211253

254+
/// <summary>
255+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
256+
/// </summary>
212257
public static async ValueTask<Result<T, E2>> MapError<T, E, E2>(
213258
this Result<T, E> result,
214259
Func<E, ValueTask<E2>> errorFactory
@@ -223,6 +268,9 @@ Func<E, ValueTask<E2>> errorFactory
223268
return Result.Failure<T, E2>(error);
224269
}
225270

271+
/// <summary>
272+
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
273+
/// </summary>
226274
public static async ValueTask<Result<T, E2>> MapError<T, E, E2, TContext>(
227275
this Result<T, E> result,
228276
Func<E, TContext, ValueTask<E2>> errorFactory,

0 commit comments

Comments
 (0)