M_CSharpx_MaybeExtensions_FromJustOrFail__1 - adutton/commandline GitHub Wiki
Extracts the element out of a Just(T) and throws an error if its argument is Nothing(T).
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static T FromJustOrFail<T>(
this Maybe<T> maybe,
Exception exceptionToThrow = null
)VB
<ExtensionAttribute>
Public Shared Function FromJustOrFail(Of T) (
maybe As Maybe(Of T),
Optional exceptionToThrow As Exception = Nothing
) As TC++
public:
[ExtensionAttribute]
generic<typename T>
static T FromJustOrFail(
Maybe<T>^ maybe,
Exception^ exceptionToThrow = nullptr
)F#
[<ExtensionAttribute>]
static member FromJustOrFail :
maybe : Maybe<'T> *
?exceptionToThrow : Exception
(* Defaults:
let _exceptionToThrow = defaultArg exceptionToThrow null
*)
-> 'T
- maybe
- Type: CSharpx.Maybe(T)
- exceptionToThrow (Optional)
- Type: System.Exception
- T
Type: T
In Visual Basic and C#, you can call this method as an instance method on any object of type Maybe(T). 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).