Skip to content

M_RailwaySharp_ErrorHandling_ResultExtensions_SelectMany__3

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

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

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

Syntax

C#

public static Result<TResult, TMessage> SelectMany<TSuccess, TMessage, TResult>(
	this Result<TSuccess, TMessage> result,
	Func<TSuccess, Result<TResult, TMessage>> func
)

VB

<ExtensionAttribute>
Public Shared Function SelectMany(Of TSuccess, TMessage, TResult) ( 
	result As Result(Of TSuccess, TMessage),
	func As Func(Of TSuccess, Result(Of TResult, TMessage))
) As Result(Of TResult, TMessage)

C++

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

F#

[<ExtensionAttribute>]
static member SelectMany : 
        result : Result<'TSuccess, 'TMessage> * 
        func : Func<'TSuccess, Result<'TResult, 'TMessage>> -> Result<'TResult, 'TMessage> 

Parameters

 

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

Type Parameters

 

TSuccess
TMessage
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