Interface IManageableCollection<TModel>
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
itemTModelThe 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
newItemTModelThe fully typed item to add
selectorPredicate<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
itemTModelThe 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
itemIndexintThe index of the item to replace within the collection
newItemTModelNew item to replace the old one with