Skip to content

M_RailwaySharp_ErrorHandling_ResultExtensions_SelectMany__4

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

ResultExtensions.SelectMany(TSuccess, TMessage, TValue, TResult) Method (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.

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

Syntax

C#

publicstaticResult<TResult,TMessage>SelectMany<TSuccess,TMessage,TValue,TResult>(thisResult<TSuccess,TMessage>result,Func<TSuccess,Result<TValue,TMessage>>func,Func<TSuccess,TValue,TResult>mapperFunc)

VB

<ExtensionAttribute>PublicSharedFunctionSelectMany(OfTSuccess,TMessage,TValue,TResult)(resultAsResult(OfTSuccess,TMessage),funcAsFunc(OfTSuccess,Result(OfTValue,TMessage)),mapperFuncAsFunc(OfTSuccess,TValue,TResult))AsResult(OfTResult,TMessage)

C++

public: [ExtensionAttribute] generic<typename TSuccess, typename TMessage, typename TValue, typename TResult> static Result<TResult, TMessage>^ SelectMany( Result<TSuccess, TMessage>^ result, Func<TSuccess, Result<TValue, TMessage>^>^ func, Func<TSuccess, TValue, TResult>^ mapperFunc )

F#

[<ExtensionAttribute>]static memberSelectMany:result :Result<'TSuccess,'TMessage>* func : Func<'TSuccess, Result<'TValue, 'TMessage>>* mapperFunc : Func<'TSuccess, 'TValue, 'TResult>-> Result<'TResult, 'TMessage>

Parameters

result
Type: RailwaySharp.ErrorHandling.Result(TSuccess, TMessage)
func
Type: System.Func(TSuccess, Result(TValue, TMessage))
mapperFunc
Type: System.Func(TSuccess, TValue, TResult)

Type Parameters

TSuccess
TMessage
TValue
TResult

Return Value

Type: Result(TResult, TMessage)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Result(TSuccess, TMessage). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

ResultExtensions Class
SelectMany Overload
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally