Skip to content

M_RailwaySharp_ErrorHandling_Result_Try__1

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

Result.Try(TSuccess) Method

Executes the given function on a given success or captures the failure.

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

Syntax

C#

public static Result<TSuccess, Exception> Try<TSuccess>(
	Func<TSuccess> func
)

VB

Public Shared Function Try(Of TSuccess) ( 
	func As Func(Of TSuccess)
) As Result(Of TSuccess, Exception)

C++

public:
generic<typename TSuccess>
static Result<TSuccess, Exception^>^ Try(
	Func<TSuccess>^ func
)

F#

static member Try : 
        func : Func<'TSuccess> -> Result<'TSuccess, Exception> 

Parameters

 

func
Type: System.Func(TSuccess)

Type Parameters

 

TSuccess

Return Value

Type: Result(TSuccess, Exception)

See Also

Reference

Result Class
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally