Click or drag to resize

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
Syntax
public static T IfNullThen<T>(
	this T checkedObject,
	T defaultValue
)
where 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: T
The 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