Class EntityCollection<T>
KeyItemCollection for EntityBase objects. Add overrides existing keys.
Implements
Inherited Members
Namespace: Loehnert.TypeAndResult
Assembly: Loehnert.TypeAndResult.dll
Syntax
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
Name | Description |
---|---|
T | The type of the elements in the collection. |
Constructors
EntityCollection()
Initializes a new instance of the EntityCollection<T> class.
Declaration
public EntityCollection()
EntityCollection(String)
Initializes a new instance of the EntityCollection<T> class.
Declaration
public EntityCollection(string collectionItemDescription)
Parameters
Type | Name | Description |
---|---|---|
String | collectionItemDescription | A short phrase for a collection item. E. g. 'User'. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
EntityCollection(String, IEnumerable<T>)
Initializes a new instance of the EntityCollection<T> class.
Declaration
public EntityCollection(string collectionItemDescription, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
String | collectionItemDescription | A short phrase for a collection item. E. g. 'User'. |
IEnumerable<T> | items | These items will be added to the collection. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
Methods
Add(T)
Adds an object to the end of the System.Collections.Generic.ICollection<T> and replaces an object with the same key.
Declaration
public override void Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to be added. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
AddRange(IEnumerable<T>)
Adds a range object to the end of the System.Collections.Generic.ICollection<T> and replaces objects with the same keys.
Declaration
public override void AddRange(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items | The object to be added. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when any |
Contains(T)
Determines whether an element is in the System.Collections.Generic.ICollection<T>.
Declaration
public override bool Contains(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to locate in the System.Collections.Generic.ICollection<T>. |
Returns
Type | Description |
---|---|
Boolean | True if item is found. |