Skip to content

M_RailwaySharp_ErrorHandling_Trial_Either__3

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

Trial.Either(TSuccess, TMessage, TResult) Method

Takes a Result and maps it with successFunc if it is a Success otherwise it maps it with failureFunc.

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

Syntax

C#

public static TResult Either<TSuccess, TMessage, TResult>(
	Func<TSuccess, IEnumerable<TMessage>, TResult> successFunc,
	Func<IEnumerable<TMessage>, TResult> failureFunc,
	Result<TSuccess, TMessage> trialResult
)

VB

Public Shared Function Either(Of TSuccess, TMessage, TResult) ( 
	successFunc As Func(Of TSuccess, IEnumerable(Of TMessage), TResult),
	failureFunc As Func(Of IEnumerable(Of TMessage), TResult),
	trialResult As Result(Of TSuccess, TMessage)
) As TResult

C++

public:
generic<typename TSuccess, typename TMessage, typename TResult>
static TResult Either(
	Func<TSuccess, IEnumerable<TMessage>^, TResult>^ successFunc, 
	Func<IEnumerable<TMessage>^, TResult>^ failureFunc, 
	Result<TSuccess, TMessage>^ trialResult
)

F#

static member Either : 
        successFunc : Func<'TSuccess, IEnumerable<'TMessage>, 'TResult> * 
        failureFunc : Func<IEnumerable<'TMessage>, 'TResult> * 
        trialResult : Result<'TSuccess, 'TMessage> -> 'TResult 

Parameters

 

successFunc
Type: System.Func(TSuccess, IEnumerable(TMessage), TResult)
failureFunc
Type: System.Func(IEnumerable(TMessage), TResult)
trialResult
Type: RailwaySharp.ErrorHandling.Result(TSuccess, TMessage)

Type Parameters

 

TSuccess
TMessage
TResult

Return Value

Type: TResult

See Also

Reference

Trial Class
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally