Click or drag to resize

MaybeTReturnTTarget Method (FuncT, TTarget, TTarget)

Returns the value extracted from the specified selector if the inner value is not null, else returns the default value.

[CanBeNull]

Namespace:  TomsToolbox.Core
Assembly:  TomsToolbox.Core (in TomsToolbox.Core.dll) Version: 1.0.75.0
Syntax
public TTarget Return<TTarget>(
	Func<T, TTarget> selector,
	TTarget defaultValue
)

Parameters

selector
Type: SystemFuncT, TTarget
The selector.

[NotNull]

defaultValue
Type: TTarget
The default value.

[CanBeNull]

Type Parameters

TTarget
The type of the target.

Return Value

Type: TTarget
The value extracted from the specified selector if the inner value is not null, else default(TTarget).
See Also