Entitas Redux
JCMG.EntitasRedux.CollectionExtension Class Reference

Static Public Member Functions

static IEntity SingleEntity (this ICollection< IEntity > collection)
 Returns the only entity in the collection. It will throw an exception if the collection doesn't have exactly one entity. More...
 
static TEntity SingleEntity< TEntity > (this ICollection< TEntity > collection)
 Returns the only entity in the collection. It will throw an exception if the collection doesn't have exactly one entity. More...
 
static IList< T > DeepCopy< T > (this IList< T > list)
 Performs a naive deep copy of an IList<T> where the deep-copy of each T value is performed by calling ICloneable.Clone. More...
 
static IList< T > ShallowCopy< T > (this IList< T > list)
 Performs a shallow copy of an IList<T> to a new list. More...
 

Detailed Description

Definition at line 32 of file CollectionExtension.cs.

Member Function Documentation

◆ DeepCopy< T >()

static IList<T> JCMG.EntitasRedux.CollectionExtension.DeepCopy< T > ( this IList< T >  list)
static

Performs a naive deep copy of an IList<T> where the deep-copy of each T value is performed by calling ICloneable.Clone.

Template Parameters
T
Parameters
list
Returns
Type Constraints
T :ICloneable 

Definition at line 77 of file CollectionExtension.cs.

◆ ShallowCopy< T >()

static IList<T> JCMG.EntitasRedux.CollectionExtension.ShallowCopy< T > ( this IList< T >  list)
static

Performs a shallow copy of an IList<T> to a new list.

Template Parameters
T
Parameters
list
Returns

Definition at line 94 of file CollectionExtension.cs.

◆ SingleEntity()

static IEntity JCMG.EntitasRedux.CollectionExtension.SingleEntity ( this ICollection< IEntity collection)
static

Returns the only entity in the collection. It will throw an exception if the collection doesn't have exactly one entity.

Parameters
collection
Returns

Definition at line 41 of file CollectionExtension.cs.

◆ SingleEntity< TEntity >()

static TEntity JCMG.EntitasRedux.CollectionExtension.SingleEntity< TEntity > ( this ICollection< TEntity >  collection)
static

Returns the only entity in the collection. It will throw an exception if the collection doesn't have exactly one entity.

Template Parameters
TEntity
Parameters
collection
Returns
Type Constraints
TEntity :class 
TEntity :IEntity 

Definition at line 59 of file CollectionExtension.cs.


The documentation for this class was generated from the following file: