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

ListEx.

Replace<T>(IList<T>, T, T, IEqualityComparer<T>) Method

Summary

Replaces the specified item.
Namespace
DynamicData
Containing Type
ListEx

Syntax

public static void Replace<T>(this IList<T> source, T original, T replaceWith, IEqualityComparer<T> comparer)

Type Parameters

Name Description
T The type of item.

Parameters

Name Type Description
source IList<T> The source.
original T The item which is to be replaced. If not in the list and argument exception will be thrown.
replaceWith T The new item.
comparer IEqualityComparer<T> The equality comparer to be used to find the original item in the list.

Return Value

Type Description
void