Skip to content

T_RailwaySharp_ErrorHandling_ResultExtensions

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

ResultExtensions Class

Extensions methods for easier usage.

Inheritance Hierarchy

System.Object
RailwaySharp.ErrorHandling.ResultExtensions
Namespace:RailwaySharp.ErrorHandling
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

internalstaticclass ResultExtensions

VB

<ExtensionAttribute>FriendNotInheritableClassResultExtensions

C++

[ExtensionAttribute] internal ref classResultExtensions abstract sealed

F#

[<AbstractClassAttribute>][<SealedAttribute>][<ExtensionAttribute>]typeResultExtensions=classend

The ResultExtensions type exposes the following members.

Methods

NameDescription
Public methodStatic memberCollect(TSuccess, TMessage) Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.
Public methodStatic memberEither(TSuccess, TMessage, TResult) Allows pattern matching on Results.
Public methodStatic memberFailedWith(TSuccess, TMessage) Returns the error messages or fails if the result was a success.
Public methodStatic memberFlatten(TSuccess, TMessage) Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.
Public methodStatic memberMap(TSuccess, TMessage, TResult) Lifts a Func into a Result and applies it on the given result.
Public methodStatic memberMatch(TSuccess, TMessage) Allows pattern matching on Results.
Public methodStatic memberSelect(TSuccess, TMessage, TResult) Lifts a Func into a Result and applies it on the given result.
Public methodStatic memberSelectMany(TSuccess, TMessage, TResult)(Result(TSuccess, TMessage), Func(TSuccess, Result(TResult, TMessage))) If the result is a Success it executes the given Func on the value. Otherwise the exisiting failure is propagated.
Public methodStatic memberSelectMany(TSuccess, TMessage, TValue, TResult)(Result(TSuccess, TMessage), Func(TSuccess, Result(TValue, TMessage)), Func(TSuccess, TValue, TResult)) 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.
Public methodStatic memberSucceededWith(TSuccess, TMessage) Returns the result or fails if the result was an error.
Back to Top

See Also

Reference

RailwaySharp.ErrorHandling Namespace

Clone this wiki locally