ImmutableList<T>::IImmutableList<T>::Replace Method (T, T, IEqualityComparer<T>^)

 

Replaces an element in the list with the specified element.

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

private:
virtual IImmutableList<T>^ Replace(
	T oldValue,
	T newValue,
	IEqualityComparer<T>^ equalityComparer
) sealed = IImmutableList<T>::Replace

Parameters

oldValue
Type: T

The element to replace.

newValue
Type: T

The element to replace the old element with.

equalityComparer
Type: System.Collections.Generic::IEqualityComparer<T>^

The equality comparer to use in the search.

Return Value

Type: System.Collections.Immutable::IImmutableList<T>^

The new list.

Exception Condition
ArgumentException

Thrown when the old value does not exist in the list.

Return to top
Show: