Skip to content

M_CSharpx_Either_Try__1

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

Either.Try(TRight) Method

Wraps a function, encapsulates any exception thrown within to a Either.

Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static Either<Exception, TRight> Try<TRight>(
	Func<TRight> func
)

VB

Public Shared Function Try(Of TRight) ( 
	func As Func(Of TRight)
) As Either(Of Exception, TRight)

C++

public:
generic<typename TRight>
static Either<Exception^, TRight>^ Try(
	Func<TRight>^ func
)

F#

static member Try : 
        func : Func<'TRight> -> Either<Exception, 'TRight> 

Parameters

 

func
Type: System.Func(TRight)

Type Parameters

 

TRight

Return Value

Type: Either(Exception, TRight)

See Also

Reference

Either Class
CSharpx Namespace

Clone this wiki locally