EntityObjectExtensionsIfNullThenT Method (T, T) |
Provides alternative to the ?? null-coalescing for domain objects.
If the checked object is null or ghost, returns the defaultValue.
Namespace:
Aloe.SystemFrameworks.Domain
Assembly:
Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic static T IfNullThen<T>(
this T checkedObject,
T defaultValue
)
where T : EntityObject
<ExtensionAttribute>
Public Shared Function IfNullThen(Of T As EntityObject) (
checkedObject As T,
defaultValue As T
) As T
public:
[ExtensionAttribute]
generic<typename T>
where T : EntityObject
static T IfNullThen(
T checkedObject,
T defaultValue
)
[<ExtensionAttribute>]
static member IfNullThen :
checkedObject : 'T *
defaultValue : 'T -> 'T when 'T : EntityObject
Parameters
- checkedObject
- Type: T
The object, which is tested for null or ghost. - defaultValue
- Type: T
The default value.
Type Parameters
- T
- The type of the objects to check.
Return Value
Type:
TThe checked object or if it is null or ghost - the defaultValue.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . 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