Table of Contents

Class EntityCollection<T>

Namespace
Loehnert.TypeAndResult
Assembly
Loehnert.TypeAndResult.dll

KeyItemCollection for EntityBase objects. Add overrides existing keys.

public class EntityCollection<T> : KeyItemCollection<T>, IKeyItemCollection<T>, IList<T>, ICollection<T>, IEnumerable<T>, INotifyCollectionChanged, IList, ICollection, IEnumerable, INotifyPropertyChanged where T : EntityBase, IHasKey

Type Parameters

T

The type of the elements in the collection.

Inheritance
EntityCollection<T>
Implements
Inherited Members

Constructors

EntityCollection()

Initializes a new instance of the EntityCollection<T> class.

public EntityCollection()

EntityCollection(string)

Initializes a new instance of the EntityCollection<T> class.

public EntityCollection(string collectionItemDescription)

Parameters

collectionItemDescription string

A short phrase for a collection item. E. g. 'User'.

Exceptions

ArgumentNullException

Thrown when collectionItemDescription is null or empty.

EntityCollection(string, IEnumerable<T>)

Initializes a new instance of the EntityCollection<T> class.

public EntityCollection(string collectionItemDescription, IEnumerable<T> items)

Parameters

collectionItemDescription string

A short phrase for a collection item. E. g. 'User'.

items IEnumerable<T>

These items will be added to the collection.

Exceptions

ArgumentNullException

Thrown when collectionItemDescription or items is null.

Methods

Add(T)

Adds an object to the end of the ICollection<T> and replaces an object with the same key.

public override void Add(T item)

Parameters

item T

The object to be added.

Exceptions

ArgumentNullException

Thrown when item is null or item.key.key is null, empty or whitespace.

AddRange(IEnumerable<T>)

Adds a range object to the end of the ICollection<T> and replaces objects with the same keys.

public override void AddRange(IEnumerable<T> items)

Parameters

items IEnumerable<T>

The object to be added.

Exceptions

ArgumentNullException

Thrown when any items.key.key is null, empty or whitespace, or items is null.

Contains(T)

Determines whether an element is in the ICollection<T>.

public override bool Contains(T item)

Parameters

item T

The object to locate in the ICollection<T>.

Returns

bool

True if item is found.