Class Result
Assembly: Recore.dll
Syntax
public static class Result
Methods
|
Improve this Doc
View Source
Collapse<T>(Result<T, T>)
Declaration
public static T Collapse<T>(this Result<T, T> result)
Parameters
Type |
Name |
Description |
Result<T, T> |
result |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Failure<TValue, TError>(TError)
Declaration
public static Result<TValue, TError> Failure<TValue, TError>(TError error)
Parameters
Type |
Name |
Description |
TError |
error |
|
Returns
Type |
Description |
Result<TValue, TError> |
|
Type Parameters
Name |
Description |
TValue |
|
TError |
|
|
Improve this Doc
View Source
Failures<TValue, TError>(IEnumerable<Result<TValue, TError>>)
Collects all the errors from failed results from the sequence.
Declaration
public static IEnumerable<TError> Failures<TValue, TError>(this IEnumerable<Result<TValue, TError>> source)
Parameters
Returns
Type Parameters
Name |
Description |
TValue |
|
TError |
|
|
Improve this Doc
View Source
Flatten<TValue, TError>(Result<Result<TValue, TError>, TError>)
Declaration
public static Result<TValue, TError> Flatten<TValue, TError>(this Result<Result<TValue, TError>, TError> resultResult)
Parameters
Type |
Name |
Description |
Result<Result<TValue, TError>, TError> |
resultResult |
|
Returns
Type |
Description |
Result<TValue, TError> |
|
Type Parameters
Name |
Description |
TValue |
|
TError |
|
|
Improve this Doc
View Source
Success<TValue, TError>(TValue)
Creates a successful result.
Declaration
public static Result<TValue, TError> Success<TValue, TError>(TValue value)
Parameters
Type |
Name |
Description |
TValue |
value |
|
Returns
Type |
Description |
Result<TValue, TError> |
|
Type Parameters
Name |
Description |
TValue |
|
TError |
|
|
Improve this Doc
View Source
Successes<TValue, TError>(IEnumerable<Result<TValue, TError>>)
Collects all the values of successful results from the sequence.
Declaration
public static IEnumerable<TValue> Successes<TValue, TError>(this IEnumerable<Result<TValue, TError>> source)
Parameters
Returns
Type Parameters
Name |
Description |
TValue |
|
TError |
|
|
Improve this Doc
View Source
Try<TValue>(Func<TValue>)
Declaration
public static Result.Catcher<TValue> Try<TValue>(Func<TValue> func)
Parameters
Type |
Name |
Description |
Func<TValue> |
func |
|
Returns
Type Parameters
|
Improve this Doc
View Source
TryAsync<TValue>(AsyncFunc<TValue>)
Declaration
public static Result.AsyncCatcher<TValue> TryAsync<TValue>(AsyncFunc<TValue> func)
Parameters
Returns
Type Parameters