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#

publicstaticEither<Exception,TRight>Try<TRight>(Func<TRight>func)

VB

PublicSharedFunctionTry(OfTRight)(funcAsFunc(OfTRight))AsEither(OfException,TRight)

C++

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

F#

static memberTry: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