Skip to content

M_RailwaySharp_ErrorHandling_ResultExtensions_Map__3

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

ResultExtensions.Map(TSuccess, TMessage, TResult) Method

Lifts a Func into a Result and applies it on the given result.

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

Syntax

C#

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

VB

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

C++

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

F#

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

Parameters

 

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

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
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally