![]() |
BadScript 2
|
Extensions methods for easier usage. More...
Static Public Member Functions | |
static void | Match< TSuccess, TMessage > (this Result< TSuccess, TMessage > result, Action< TSuccess, IEnumerable< TMessage > > ifSuccess, Action< IEnumerable< TMessage > > ifFailure) |
Allows pattern matching on Results. | |
static TResult | Either< TSuccess, TMessage, TResult > (this Result< TSuccess, TMessage > result, Func< TSuccess, IEnumerable< TMessage >, TResult > ifSuccess, Func< IEnumerable< TMessage >, TResult > ifFailure) |
Allows pattern matching on Results. | |
static Result< TResult, TMessage > | Map< TSuccess, TMessage, TResult > (this Result< TSuccess, TMessage > result, Func< TSuccess, TResult > func) |
Lifts a Func into a Result and applies it on the given result. | |
static Result< IEnumerable< TSuccess >, TMessage > | Collect< TSuccess, TMessage > (this IEnumerable< Result< TSuccess, TMessage > > values) |
Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated. | |
static Result< IEnumerable< TSuccess >, TMessage > | Flatten< TSuccess, TMessage > (this Result< IEnumerable< Result< TSuccess, TMessage > >, TMessage > result) |
Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated. | |
static Result< TResult, TMessage > | SelectMany< TSuccess, TMessage, TResult > (this Result< TSuccess, TMessage > result, Func< TSuccess, Result< TResult, TMessage > > func) |
If the result is a Success it executes the given Func on the value. Otherwise the exisiting failure is propagated. | |
static Result< TResult, TMessage > | SelectMany< TSuccess, TMessage, TValue, TResult > (this Result< TSuccess, TMessage > result, Func< TSuccess, Result< TValue, TMessage > > func, Func< TSuccess, TValue, TResult > mapperFunc) |
If the result is a Success it executes the given Func on the value. If the result of the Func is a Success it maps it using the given Func. Otherwise the exisiting failure is propagated. | |
static Result< TResult, TMessage > | Select< TSuccess, TMessage, TResult > (this Result< TSuccess, TMessage > result, Func< TSuccess, TResult > func) |
Lifts a Func into a Result and applies it on the given result. | |
static IEnumerable< TMessage > | FailedWith< TSuccess, TMessage > (this Result< TSuccess, TMessage > result) |
Returns the error messages or fails if the result was a success. | |
static TSuccess | SucceededWith< TSuccess, TMessage > (this Result< TSuccess, TMessage > result) |
Returns the result or fails if the result was an error. | |
static IEnumerable< TMessage > | SuccessMessages< TSuccess, TMessage > (this Result< TSuccess, TMessage > result) |
Returns messages in case of success, otherwise an empty sequence. | |
Extensions methods for easier usage.
Definition at line 547 of file ErrorHandling.cs.
|
static |
Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.
Definition at line 615 of file ErrorHandling.cs.
|
static |
Allows pattern matching on Results.
Definition at line 588 of file ErrorHandling.cs.
|
static |
Returns the error messages or fails if the result was a success.
Definition at line 724 of file ErrorHandling.cs.
|
static |
Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.
Definition at line 628 of file ErrorHandling.cs.
|
static |
Lifts a Func into a Result and applies it on the given result.
Definition at line 602 of file ErrorHandling.cs.
|
static |
Allows pattern matching on Results.
Definition at line 555 of file ErrorHandling.cs.
|
static |
Lifts a Func into a Result and applies it on the given result.
Definition at line 711 of file ErrorHandling.cs.
|
static |
If the result is a Success it executes the given Func on the value. Otherwise the exisiting failure is propagated.
Definition at line 663 of file ErrorHandling.cs.
|
static |
If the result is a Success it executes the given Func on the value. If the result of the Func is a Success it maps it using the given Func. Otherwise the exisiting failure is propagated.
Definition at line 678 of file ErrorHandling.cs.
|
static |
Returns the result or fails if the result was an error.
Definition at line 750 of file ErrorHandling.cs.
|
static |
Returns messages in case of success, otherwise an empty sequence.
Definition at line 770 of file ErrorHandling.cs.