- 
                Notifications
    
You must be signed in to change notification settings  - Fork 35
 
M_CodeJam_NullableHelper_GetValueOrDefault__1
        Andrew Koryavchenko edited this page Jun 17, 2018 
        ·
        5 revisions
      
    Retrieves the value of the current Nullable(T) object, or value returned by factory.
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static T GetValueOrDefault<T>(
	Nullable<T> value,
	Func<T> defaultFactory
)
where T : struct, new()VB
Public Shared Function GetValueOrDefault(Of T As {Structure, New}) ( 
	value As Nullable(Of T),
	defaultFactory As Func(Of T)
) As TF#
static member GetValueOrDefault : 
        value : Nullable<'T> * 
        defaultFactory : Func<'T> -> 'T  when 'T : struct, new()
- value
 - Type: System.Nullable(T)
Nullable value. - defaultFactory
 - Type: System.Func(T)
A function to return default value if the HasValue property isfalse. 
- T
 - The underlying value type of the Nullable(T) generic type.
 
Type: T
The value of the Value property if the HasValue property is true; otherwise, the value returned by defaultFactory parameter.