Interface IManageableCollection<TModel>
Defines the behavior of a collection that can be managed with fully typed prototype methods
Inherited Members
Namespace: PnP.Core.Model
Assembly: PnP.Core.dll
Syntax
public interface IManageableCollection<TModel> : IManageableCollection
  Type Parameters
| 
        TModel
         
  | 
    
Methods
Add(TModel)
Method to add a new item to the collection
Declaration
void Add(TModel item)
  Parameters
| 
        TModel
        item
         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
Declaration
void AddOrUpdate(TModel newItem, Predicate<TModel> selector)
  Parameters
| 
        TModel
        newItem
         The fully typed item to add  | 
    
| 
        Predicate<TModel>
        selector
         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
Declaration
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
Declaration
TModel CreateNewAndAdd()
  Returns
| 
        TModel
         The new item, added to the collection  | 
    
Remove(TModel)
Method to remove an fully typed item from the collection
Declaration
bool Remove(TModel item)
  Parameters
| 
        TModel
        item
         The fully typed item to remove  | 
    
Returns
| 
        System.Boolean
         True if the removal is successful  | 
    
Replace(Int32, TModel)
Replaces an item in the collection with a new one
Declaration
void Replace(int itemIndex, TModel newItem)
  Parameters
| 
        System.Int32
        itemIndex
         The index of the item to replace within the collection  | 
    
| 
        TModel
        newItem
         New item to replace the old one with  |