M_CSharpx_MaybeExtensions_MapValueOrDefault__2 - adutton/commandline GitHub Wiki
If contains a values executes a mapping function over it, otherwise returns noneValue.
Namespace: CSharpx
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static T2 MapValueOrDefault<T1, T2>(
this Maybe<T1> maybe,
Func<T1, T2> func,
T2 noneValue
)VB
<ExtensionAttribute>
Public Shared Function MapValueOrDefault(Of T1, T2) (
maybe As Maybe(Of T1),
func As Func(Of T1, T2),
noneValue As T2
) As T2C++
public:
[ExtensionAttribute]
generic<typename T1, typename T2>
static T2 MapValueOrDefault(
Maybe<T1>^ maybe,
Func<T1, T2>^ func,
T2 noneValue
)F#
[<ExtensionAttribute>]
static member MapValueOrDefault :
maybe : Maybe<'T1> *
func : Func<'T1, 'T2> *
noneValue : 'T2 -> 'T2
- maybe
- Type: CSharpx.Maybe(T1)
- func
- Type: System.Func(T1, T2)
- noneValue
- Type: T2
- T1
- T2
Type: T2
In Visual Basic and C#, you can call this method as an instance method on any object of type Maybe(T1). 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).