Table of Contents

Interface IListItemCollection

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Public interface to define a collection of ListItem objects of SharePoint Online

public interface IListItemCollection : IQueryable<IListItem>, IQueryable, IAsyncEnumerable<IListItem>, IDataModelCollection<IListItem>, IEnumerable<IListItem>, IEnumerable, IDataModelParent, IDataModelWithContext, IRequestableCollection, IDataModelCollectionLoad<IListItem>, IDataModelCollectionDeleteByIntegerId, ISupportModules<IListItemCollection>
Inherited Members
Extension Methods

Methods

Add(Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

IListItem Add(Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

IListItem

Newly added list item

AddAsync(Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

Task<IListItem> AddAsync(Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

Task<IListItem>

Newly added list item

AddBatch(Batch, Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

IListItem AddBatch(Batch batch, Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

batch Batch

Batch to use

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

IListItem

Newly added list item

AddBatch(Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

IListItem AddBatch(Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

IListItem

Newly added list item

AddBatchAsync(Batch, Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

Task<IListItem> AddBatchAsync(Batch batch, Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

batch Batch

Batch to use

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

Task<IListItem>

Newly added list item

AddBatchAsync(Dictionary<string, object>, string, FileSystemObjectType)

Adds a new list item

Task<IListItem> AddBatchAsync(Dictionary<string, object> values, string folderPath = null, FileSystemObjectType underlyingObjectType = FileSystemObjectType.File)

Parameters

values Dictionary<string, object>

Values to add to list item

folderPath string

Optional folder path to add the item to.

underlyingObjectType FileSystemObjectType

Type of object to create. Defaults to File/ListItem

Returns

Task<IListItem>

Newly added list item

Contains(int)

Checks if the collection contains a listitem with a given id

bool Contains(int id)

Parameters

id int

Id to check for

Returns

bool

True if found, false otherwise

GetById(int, params Expression<Func<IListItem, object>>[])

Method to select a list item by Id

IListItem GetById(int id, params Expression<Func<IListItem, object>>[] selectors)

Parameters

id int

The Id to search for

selectors Expression<Func<IListItem, object>>[]

The expressions declaring the fields to select

Returns

IListItem

The resulting list item instance, if any

GetByIdAsync(int, params Expression<Func<IListItem, object>>[])

Method to select a list item by Id asynchronously

Task<IListItem> GetByIdAsync(int id, params Expression<Func<IListItem, object>>[] selectors)

Parameters

id int

The Id to search for

selectors Expression<Func<IListItem, object>>[]

The expressions declaring the fields to select

Returns

Task<IListItem>

The resulting list item instance, if any

RecycleById(int)

Recycle the list item

Guid RecycleById(int id)

Parameters

id int

Id of the item to recycle

Returns

Guid

RecycleByIdAsync(int)

Recycle the list item

Task<Guid> RecycleByIdAsync(int id)

Parameters

id int

Id of the item to recycle

Returns

Task<Guid>

RecycleByIdBatch(Batch, int)

Recycle the list item

void RecycleByIdBatch(Batch batch, int id)

Parameters

batch Batch

Batch to add the request to

id int

Id of the item to recycle

RecycleByIdBatch(int)

Recycle the list item

void RecycleByIdBatch(int id)

Parameters

id int

Id of the item to recycle

RecycleByIdBatchAsync(Batch, int)

Recycle the list item

Task RecycleByIdBatchAsync(Batch batch, int id)

Parameters

batch Batch

Batch to add the request to

id int

Id of the item to recycle

Returns

Task

RecycleByIdBatchAsync(int)

Recycle the list item

Task RecycleByIdBatchAsync(int id)

Parameters

id int

Id of the item to recycle

Returns

Task