The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

OptionExtensions.

FirstOrOptional<T>(IEnumerable<T>, Func<T, bool>) Method

Summary

Overloads Enumerable.FirstOrDefault() and wraps the result in a Optional &gt;T container.
Namespace
DynamicData.Kernel
Containing Type
OptionExtensions

Syntax

public static Optional<T> FirstOrOptional<T>(this IEnumerable<T> source, Func<T, bool> selector)

Type Parameters

Name Description
T The type of the item.

Parameters

Name Type Description
source IEnumerable<T> The source.
selector Func<T, bool> The selector.

Return Value

Type Description
Optional<T> The first value or none.