Method MapOrNull
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
MapOrNull<TOut>(Func<T, TOut>)
Maps to <xref href="DisCatSharp.Entities.Optional%601.None" data-throw-if-not-resolved="false"></xref> for <xref href="DisCatSharp.Entities.Optional%601.None" data-throw-if-not-resolved="false"></xref>, to
default
for
null
and to the mapped value otherwise./>
public Optional<TOut> MapOrNull<TOut>(Func<T, TOut> mapper)
Parameters
mapperFunc<T, TOut>The function that does the mapping of the non-null
T.
Returns
- Optional<TOut>
The mapped value.
Type Parameters
TOutThe type to map to.