Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Interface IPersistentList<T>

Represents an IList<T> which is persisted to a backing store.

Inherited Members
ICollection.CopyTo(Array, int)
ICollection.Count
ICollection.SyncRoot
ICollection.IsSynchronized
IList<T>.IndexOf(T)
IList<T>.Insert(int, T)
IList<T>.RemoveAt(int)
IList<T>.this[int]
ICollection<T>.Add(T)
ICollection<T>.Clear()
ICollection<T>.Contains(T)
ICollection<T>.CopyTo(T[], int)
ICollection<T>.Remove(T)
ICollection<T>.IsReadOnly
IEnumerable<T>.GetEnumerator()
IAsyncEnumerable<T>.GetAsyncEnumerator(CancellationToken)
Namespace: Couchbase.DataStructures
Assembly: Couchbase.NetClient.dll
Syntax
public interface IPersistentList<T> : ICollection, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IAsyncEnumerable<T>
Type Parameters
Name Description
T

Type of value in the set.

Remarks

If using a SystemTextJsonSerializer backed by a JsonSerializerContext, be sure to include IList<T> in a JsonSerializableAttribute on the context. Note that a reference comparision is used by default. If you load the list and try to use an item out of it to remove from the list, it will return false unless Object.Equals() is overridden on the item's class as the document is reloaded from the database and therefore cannot be used for reference equality. Note that .NET Records override Equals implicitly.

Properties

View Source

CountAsync

Counts the items in the list.

Declaration
Task<int> CountAsync { get; }
Property Value
Type Description
Task<int>

A Task<TResult> for awaiting. The value is the number of items in the list.

Methods

View Source

AddAsync(T)

Adds an item into the document.

Declaration
Task AddAsync(T item)
Parameters
Type Name Description
T item

The item to add.

Returns
Type Description
Task

A Task for awaiting.

Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

View Source

ClearAsync()

Clears the document.

Declaration
Task ClearAsync()
Returns
Type Description
Task

A Task for awaiting.

View Source

ContainsAsync(T)

Checks to see if the document contains an item.

Declaration
Task<bool> ContainsAsync(T item)
Parameters
Type Name Description
T item

The item T to check for its existence.

Returns
Type Description
Task<bool>

A Task<TResult> for awaiting. True if the item exists, otherwise false.

Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

View Source

CopyToAsync(Array, int)

Copies an items into an array starting at an index.

Declaration
Task CopyToAsync(Array array, int index)
Parameters
Type Name Description
Array array

The array of items to add to the document.

int index

The starting index.

Returns
Type Description
Task
View Source

CopyToAsync(T[], int)

Copies an array into the document.

Declaration
Task CopyToAsync(T[] array, int arrayIndex)
Parameters
Type Name Description
T[] array

The array of items to add to the document.

int arrayIndex

The starting index.

Returns
Type Description
Task

A Task for awaiting.

View Source

IndexOfAsync(T)

Returns the index of item in the list.

Declaration
Task<int> IndexOfAsync(T item)
Parameters
Type Name Description
T item

An item which should have Object.Equals() overridden.

Returns
Type Description
Task<int>

A Task<TResult> for awaiting. The value is the index of item in the list.

Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

View Source

InsertAsync(int, T)

Inserts an item into the list.

Declaration
Task InsertAsync(int index, T item)
Parameters
Type Name Description
int index

The starting index.

T item

An item which should have Object.Equals() overridden.

Returns
Type Description
Task
Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

View Source

RemoveAsync(T)

Attempts to remove an item from the list.

Declaration
Task<bool> RemoveAsync(T item)
Parameters
Type Name Description
T item

An item which should have Object.Equals() overridden.

Returns
Type Description
Task<bool>

True if the item is found and removed; otherwise false.

Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

View Source

RemoveAtAsync(int)

Removes an item item from the list.

Declaration
Task RemoveAtAsync(int index)
Parameters
Type Name Description
int index

The starting index.

Returns
Type Description
Task

A Task for awaiting."

Remarks

Override Object.Equals if using POCOs; .NET Records do so implicitly.

  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.