EntityCollection<TEntity> Class

 

Collection of entities modeling a particular EDM construct which can either be all entities of a particular type or entities participating in a particular relationship.

Namespace:   System.Data.Entity.Core.Objects.DataClasses
Assembly:  EntityFramework (in EntityFramework.dll)

System.Object
  System.Data.Entity.Core.Objects.DataClasses.RelatedEnd
    System.Data.Entity.Core.Objects.DataClasses.EntityCollection<TEntity>

[SerializableAttribute]
public class EntityCollection<TEntity> : RelatedEnd, ICollection<TEntity>, 
	IEnumerable<TEntity>, IEnumerable, IListSource
where TEntity : class

Type Parameters

TEntity

The type of entities in this collection.

NameDescription
System_CAPS_pubmethodEntityCollection<TEntity>()

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

NameDescription
System_CAPS_pubpropertyCount

Gets the number of objects that are contained in the collection.

System_CAPS_pubpropertyIsLoaded

Gets a value that indicates whether all related objects have been loaded.(Inherited from RelatedEnd.)

System_CAPS_pubpropertyIsReadOnly

Gets a value that indicates whether the EntityCollection<TEntity> is read-only.

System_CAPS_pubpropertyRelationshipName

Gets the name of the relationship in which this related end participates.(Inherited from RelatedEnd.)

System_CAPS_pubpropertyRelationshipSet

Gets a reference to the metadata for the related end.(Inherited from RelatedEnd.)

System_CAPS_pubpropertySourceRoleName

Gets the role name at the source end of the relationship.(Inherited from RelatedEnd.)

System_CAPS_pubpropertyTargetRoleName

Gets the role name at the target end of the relationship.(Inherited from RelatedEnd.)

NameDescription
System_CAPS_pubmethodAdd(TEntity)

Adds an object to the collection.

System_CAPS_pubmethodAttach(TEntity)

Defines a relationship between two attached objects in an object context.

System_CAPS_pubmethodAttach(IEnumerable<TEntity>)

Defines relationships between an object and a collection of related objects in an object context.

System_CAPS_pubmethodClear()

Removes all entities from the collection.

System_CAPS_pubmethodContains(TEntity)

Determines whether a specific object exists in the collection.

System_CAPS_pubmethodCopyTo(TEntity[], Int32)

Copies all the contents of the collection to an array, starting at the specified index of the target array.

System_CAPS_pubmethodCreateSourceQuery()

Returns an object query that, when it is executed, returns the same set of objects that exists in the current collection.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that is used to iterate through the objects in the collection.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodLoad()

Loads the related object or objects into the related end with the default merge option.(Inherited from RelatedEnd.)

System_CAPS_pubmethodLoad(MergeOption)

Loads related objects into the collection, using the specified merge option.(Overrides RelatedEnd.Load(MergeOption).)

System_CAPS_pubmethodLoadAsync(CancellationToken)

Asynchronously loads the related object or objects into the related end with the default merge option.(Inherited from RelatedEnd.)

System_CAPS_pubmethodLoadAsync(MergeOption, CancellationToken)

Asynchronously loads the related entity or entities into the related end using the default merge option.(Overrides RelatedEnd.LoadAsync(MergeOption, CancellationToken).)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodOnCollectionDeserialized(StreamingContext)

Used internally to deserialize entity objects.

System_CAPS_pubmethodOnDeserialized(StreamingContext)

Used internally to deserialize entity objects along with the RelationshipManager instances.(Inherited from RelatedEnd.)

System_CAPS_pubmethodOnSerializing(StreamingContext)

Used internally to serialize entity objects.

System_CAPS_pubmethodRemove(TEntity)

Removes an object from the collection and marks the relationship for deletion.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventAssociationChanged

Occurs when a change is made to a related end.(Inherited from RelatedEnd.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that is used to iterate through the set of values cached by EntityCollection<TEntity> .

System_CAPS_pubinterfaceSystem_CAPS_privmethodIListSource.GetList()

Returns the collection as an IList used for data binding.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Add(IEntityWithRelationships)

Adds an entity to the related end. This method works in exactly the same way as Add(object). It is maintained for backward compatibility with previous versions of IRelatedEnd.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Add(Object)

Adds an entity to the related end. If the owner is attached to a cache then the all the connected ends are added to the object cache and their corresponding relationships are also added to the ObjectStateManager. The RelatedEnd of the relationship is also fixed.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Attach(IEntityWithRelationships)

Attaches an entity to the related end. This method works in exactly the same way as Attach(object). It is maintained for backward compatibility with previous versions of IRelatedEnd.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Attach(Object)

Attaches an entity to the related end. If the related end is already filled or partially filled, this merges the existing entities with the given entity. The given entity is not assumed to be the complete set of related entities. Owner and all entities passed in must be in Unchanged or Modified state. Deleted elements are allowed only when the state manager is already tracking the relationship instance.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.CreateSourceQuery()

Returns an IEnumerable that represents the objects that belong to the related end.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Remove(IEntityWithRelationships)

Removes an entity from the related end. This method works in exactly the same way as Remove(object). It is maintained for backward compatibility with previous versions of IRelatedEnd.(Inherited from RelatedEnd.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIRelatedEnd.Remove(Object)

Removes an entity from the related end. If owner is attached to a cache, marks relationship for deletion and if the relationship is composition also marks the entity for deletion.(Inherited from RelatedEnd.)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.