NullableExtensionsMapT, TResult(T, ReadOnlySpanFuncT, TResult) Method

Applies a mapping function to a value that may be .

Definition

Namespace: Ookii.Common
Assembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
C#
public static NullableReadOnlySpan<TResult> Map<T, TResult>(
	this T self,
	ReadOnlySpanFunc<T, TResult> map
)
where T : class

Parameters

self  T
The value to map. May be .
map  ReadOnlySpanFuncT, TResult
The function to apply to the value.

Type Parameters

T
The type of the value.
TResult
The type of the items in the resulting NullableReadOnlySpanT.

Return Value

NullableReadOnlySpanTResult
If self is not , the result of applying map to self; otherwise, .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T. 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).

Remarks

The map function is only called if self is not .

See Also