[]
        
(Showing Draft Content)

C1.DataCollection.IDataCollectionEx.ReplaceAsync

ReplaceAsync Method

ReplaceAsync<T>(IDataCollection<T>, int, T, CancellationToken)

Replaces the item at the specified index by the specified item.

Declaration
public static Task<int> ReplaceAsync<T>(this IDataCollection<T> dataCollection, int index, T item, CancellationToken cancellationToken = default) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

int index

The index.

T item

The item.

CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
Task<int>
Type Parameters
Name Description
T

ReplaceAsync<T>(IDataCollection<T>, int, T)

Replaces the item at the specified index by the specified item.

Declaration
public static Task<int> ReplaceAsync<T>(this IDataCollection<T> dataCollection, int index, T item) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

int index

The index.

T item

The item.

Returns
Type Description
Task<int>
Type Parameters
Name Description
T