Skip to content

M_CSharpx_MaybeExtensions_GetValueOrDefault__1

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

MaybeExtensions.GetValueOrDefault(T) Method

If contains a values returns it, otherwise returns noneValue.

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

Syntax

C#

public static T GetValueOrDefault<T>(
	this Maybe<T> maybe,
	T noneValue
)

VB

<ExtensionAttribute>
Public Shared Function GetValueOrDefault(Of T) ( 
	maybe As Maybe(Of T),
	noneValue As T
) As T

C++

public:
[ExtensionAttribute]
generic<typename T>
static T GetValueOrDefault(
	Maybe<T>^ maybe, 
	T noneValue
)

F#

[<ExtensionAttribute>]
static member GetValueOrDefault : 
        maybe : Maybe<'T> * 
        noneValue : 'T -> 'T 

Parameters

 

maybe
Type: CSharpx.Maybe(T)
noneValue
Type: T

Type Parameters

 

T

Return Value

Type: T

Usage Note

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).

See Also

Reference

MaybeExtensions Class
CSharpx Namespace

Clone this wiki locally