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

ListEx.

IndexOfOptional<T>(IEnumerable<T>, T, IEqualityComparer<T>?) Method

Summary

Lookups the item using the specified comparer. If matched, the item's index is also returned.
Namespace
DynamicData
Containing Type
ListEx

Syntax

public static Optional<ItemWithIndex<T>> IndexOfOptional<T>(this IEnumerable<T> source, T item, IEqualityComparer<T>? equalityComparer = null)

Type Parameters

Name Description
T The type of the item.

Parameters

Name Type Description
source IEnumerable<T> The source.
item T The item.
equalityComparer IEqualityComparer<T>? The equality comparer.

Return Value

Type Description
Optional<ItemWithIndex<T>> The index of the item if available.