Table of Contents

Interface IManageableCollection<TModel>

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

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

public interface IManageableCollection<TModel> : IManageableCollection

Type Parameters

TModel
Inherited Members

Methods

Add(TModel)

Method to add a new item to the collection

void Add(TModel item)

Parameters

item TModel

The untyped item to add

AddOrUpdate(TModel, Predicate<TModel>)

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

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

Parameters

newItem TModel

The fully typed item to add

selector Predicate<TModel>

The selection predicate for the already existing item, if any

CreateNew()

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

TModel CreateNew()

Returns

TModel

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

TModel CreateNewAndAdd()

Returns

TModel

The new item, added to the collection

Remove(TModel)

Method to remove an fully typed item from the collection

bool Remove(TModel item)

Parameters

item TModel

The fully typed item to remove

Returns

bool

True if the removal is successful

Replace(int, TModel)

Replaces an item in the collection with a new one

void Replace(int itemIndex, TModel newItem)

Parameters

itemIndex int

The index of the item to replace within the collection

newItem TModel

New item to replace the old one with