Table of Contents

Interface IManageableCollection

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

Defines the behavior of a collection that can be managed with untyped prototype methods

public interface IManageableCollection

Methods

Add(object)

Method to add a new item to the collection

void Add(object item)

Parameters

item object

The untyped item to add

AddOrUpdate(object, Predicate<object>)

Method to add a new untyped item or update an already existing one based on a selection predicate

void AddOrUpdate(object newItem, Predicate<object> selector)

Parameters

newItem object

The untyped item to add

selector Predicate<object>

The selection predicate for the already existing item, if any

CreateNew()

Method to create a new item of the collection, ready to be added to the same collection

object CreateNew()

Returns

object

The new item, ready to be added to the current collection

CreateNewAndAdd()

Method to create a new typed item of the collection and immediately add it the collection

object CreateNewAndAdd()

Returns

object

The new item, added to the collection

Remove(object)

Method to remove an untyped item from the collection

bool Remove(object item)

Parameters

item object

The untyped item to remove

Returns

bool

True if the removal is successful

Replace(int, object)

Replaces an item in the collection with a new one

void Replace(int itemIndex, object newItem)

Parameters

itemIndex int

The index of the item to replace within the collection

newItem object

New item to replace the old one with