[]
        
(Showing Draft Content)

C1.DataCollection.IDataCollectionEx.InsertAsync

InsertAsync Method

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

Inserts the specified item at the specified index in the collection.

Declaration
public static Task<int> InsertAsync<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 where the item will be inserted.

T item

The item to be inserted.

CancellationToken cancellationToken

The cancellation token.

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

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

Inserts the specified item at the specified index in the collection.

Declaration
public static Task<int> InsertAsync<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 where the item will be inserted.

T item

The item to be inserted.

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