Click or drag to resize

IEntityCollection Interface

Interface for the EntityCollection type. The collection defines typed basic collection behavior. Selfservicing specific

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.6.0.0 (5.6.19.0117)
Syntax
public interface IEntityCollection : IEntityCollectionCore, 
	IActiveContextParticipant, IEnumerable

The IEntityCollection type exposes the following members.

Properties
  NameDescription
Public propertyActiveContext
Gets / sets the active context this object is in. Setting this property is not adding the object to the context, it will make contained entities be added to the passed in context. If the object is already in a context, setting this property has no effect. Setting this property is done by framework code, use the Context's Add/Get methods to work with contexts and entities.
(Inherited from IActiveContextParticipant.)
Public propertyAllowEdit
Default: true. If set to false, entities inside this collection won't be editable in a complex databinding scenario.
(Inherited from IEntityCollectionCore.)
Public propertyAllowNew
Default: true. If set to false, no new entities will be added through databinding.
(Inherited from IEntityCollectionCore.)
Public propertyAllowRemove
Default: false. If set to true, entities can be removed through databinding.
(Inherited from IEntityCollectionCore.)
Public propertyCapacity
Gets / sets the initial capacity of the entity collection.
Public propertyConcurrencyPredicateFactoryToUse
Gets / sets the IConcurrencyPredicateFactory instance to use when creating entity objects during a GetMulti() call or when AddNew is called.
Public propertyContainingEntityMappedField
Gets the name of the field mapped onto the relation in the opposite entity which is represented by this collection, if this collection is contained by an entity. E.g. it will return "Customer" if the relation Customer - Order has the field 'Customer' mapped onto it in Order and this collection is the Orders collection in Customer. If this collection isn't contained in any entity, an empty string is returned.
(Inherited from IEntityCollectionCore.)
Public propertyContainsDirtyContents
Returns true if this collection contains dirty objects. If this collection contains dirty objects, an already filled collection should not be refreshed until a save is performed. This property is calculated in real time and can be time consuming when the collection contains a lot of objects. Use this property only in cases when the value of this property is used to do a refetch or not.
Public propertyCount
The amount of IEntity2 elements in this entity collection
(Inherited from IEntityCollectionCore.)
Public propertyDefaultView
Gets the default view for this entitycollection. The returned value is the same instance every time this property is read. It's a new entity view without a filter or a sorter.
Public propertyDirtyEntities
Returns a readonly collection of entities which are flagged as dirty. This collection is determined on the fly, you can use this collection to remove dirty entities from this entity collection.
Public propertyDoNotPerformAddIfPresent
When set to true, an entity passed to Add() or Insert() will be tested if it's already present. If so, the index is returned and the object is not added again. If set to false (default: true) this check is not performed. Setting this property to true can slow down fetch logic. DataAccessAdapter's fetch logic sets this property to false during a multi-entity fetch.
Public propertyEntityFactoryToUse
The EntityFactory to use when creating entity objects during a GetMulti() call or other logic which requires the creation of new entities.
Public propertyIsForMN
Gets or sets a value indicating whether this instance is for a M:N relationship. If set to true, it will also set IsReadOnly to true.
(Inherited from IEntityCollectionCore.)
Public propertyIsReadOnly
Get / set the readonly flag for this collection.
(Inherited from IEntityCollectionCore.)
Public propertyIsRemovalTracker
Gets or sets a value indicating whether this instance is a removal tracker collection.
(Inherited from IEntityCollectionCore.)
Public propertyItem
Gets or sets the IEntity at the specified index.
Public propertyMaxNumberOfItemsToReturn
The maximum number of items to return with this retrieval query. If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.
Public propertyRemovedEntitiesTracker
Gets or sets the entity collection which should be used as removed entities tracker. If this property is set to an IEntityCollection2 instance, all entities which are removed from this collection are marked for deletion and placed in this removed entities tracker collection. This collection can then later on be used to delete these entities from the database in one go.
Public propertySortClauses
The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.
Public propertySuppressClearInGetMulti
Surpresses the removal of all contents of the collection in a GetMulti*() call. Used by code in related entities to prevent the removal of objects when collection properties are accessed.
Top
Methods
  NameDescription
Public methodAdd(IEntity)
Adds an IEntity object to the list.
Public methodAdd(IEntityCore)
Adds an IEntityCore object to the list.
(Inherited from IEntityCollectionCore.)
Public methodAddRange
Adds the range of objects passed in. Objects have to be IEntity implementing objects
Public methodClear
Clears the collection
(Inherited from IEntityCollectionCore.)
Public methodClear(Boolean)
Clears the collection
(Inherited from IEntityCollectionCore.)
Public methodContains(IEntity)
Returns true if the list contains the given IEntity Object
Public methodContains(IEntityCore)
Returns true if the list contains the given entity
(Inherited from IEntityCollectionCore.)
Public methodCopyTo
copy the complete list of IEntity objects to an array of IEntity objects.
Public methodCreateHierarchicalProjection(DictionaryType, IEntityCollection)
Creates a hierarchical projection of all the data in this collection and for each type in the complete graph found starting with each entity in this collection. Per entity type found, an entry is stored inside the destination dictionary. It will simply project every data element.
Public methodCreateHierarchicalProjection(DataSet)
Creates a hierarchical projection of all the data in this collection and for each type in the complete graph found starting with each entity in this collection. Per entity type found, a new datatable is created inside destination or if one with the name of the entity is already present, that one is used. It will simply project every data element.
Public methodCreateHierarchicalProjection(ListIViewProjectionData, DictionaryType, IEntityCollection)
Creates a hierarchical projection of all the data in this collection and for each type in the complete graph found starting with each entity in this collection, using the collectionProjections data passed in. Per entity type found, an entry is stored inside the destination dictionary.
Public methodCreateHierarchicalProjection(ListIViewProjectionData, DataSet)
Creates a hierarchical projection of all the data in this collection and for each type in the complete graph found starting with each entity in this collection, using the collectionProjections data passed in. Per entity type found, a new datatable is created inside destination or if one with the name of the entity is already present, that one is used.
Public methodCreateView
Creates a new EntityView object of the right type on this collection with no filter nor sorter applied.
Public methodCreateView(IPredicate)
Creates a new EntityView object of the right type on this collection with the passed in filter applied
Public methodCreateView(IPredicate, ISortExpression)
Creates a new EntityView object of the right type on this collection with the passed in filter and sorter applied to it.
Public methodCreateView(IPredicate, ISortExpression, PostCollectionChangeAction)
Creates a new EntityView object of the right type on this collection with the passed in filter and sorter applied to it and the dataChangeAction set to the passed in value.
Public methodDeleteMulti
Deletes all Entities in the IEntityCollection from the persistent storage. If this IEntityCollection is added to a transaction, the delete processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the deletes are done in a new Transaction (which is created in an inherited method.) Deleted entities are marked deleted and are removed from the collection.
Public methodDeleteMulti(IPredicate)
Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodDeleteMulti(IPredicate, IRelationCollection)
Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodDeleteMultiAsync
Async variant of DeleteMulti. Deletes all Entities in the IEntityCollection from the persistent storage. If this IEntityCollection is added to a transaction, the delete processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the deletes are done in a/ new Transaction. Deleted entities are marked deleted and are removed from the collection.
Public methodDeleteMultiAsync(CancellationToken)
Async variant of DeleteMulti. Deletes all Entities in the IEntityCollection from the persistent storage. If this IEntityCollection is added to a transaction, the delete processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the deletes are done in a/ new Transaction. Deleted entities are marked deleted and are removed from the collection.
Public methodDeleteMultiAsync(IPredicate)
Async variant of DeleteMulti(IPredicate). Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodDeleteMultiAsync(IPredicate, IRelationCollection)
Async variant of DeleteMulti(IPredicate, IRelationCollection). Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodDeleteMultiAsync(IPredicate, CancellationToken)
Async variant of DeleteMulti(IPredicate). Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodDeleteMultiAsync(IPredicate, IRelationCollection, CancellationToken)
Async variant of DeleteMulti(IPredicate, IRelationCollection). Deletes from the persistent storage all entities of the type this collection is for which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodFetchExcludedFields
Loads the data for the excluded fields specified in the list of excluded fields into all the entities in this collection.
Public methodFetchExcludedFieldsAsync
Async variant of FetchExcludedFields(ExcludeIncludeFieldsList). Loads the data for the excluded fields specified in the list of excluded fields into all the entities in this collection.
Public methodFindMatches
Gets all indices of all the entities in the current order of this collection which match the passed in filter.
(Inherited from IEntityCollectionCore.)
Public methodGetDbCount
Gets the amount of Entity objects in the database.
Public methodGetDbCount(IPredicate)
Gets the amount of Entity objects in the database, when taking into account the filter specified.
Public methodGetDbCount(IPredicate, IRelationCollection)
Gets the amount of Entity objects in the database, when taking into account the filter specified and the relations specified.
Public methodGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from IEnumerable.)
Public methodGetMulti(IPredicate)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, IPrefetchPath)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodGetMulti(IPredicate, IRelationCollection)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, Int64)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, ExcludeIncludeFieldsList, IPrefetchPath)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodGetMulti(IPredicate, ExcludeIncludeFieldsList, Int64)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, Int64, ISortExpression)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, Int64, ISortExpression, IRelationCollection)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition.
Public methodGetMulti(IPredicate, Int64, ISortExpression, IRelationCollection, IPrefetchPath)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodGetMulti(IPredicate, Int64, ISortExpression, IRelationCollection, Int32, Int32)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodGetMulti(IPredicate, Int64, ISortExpression, IRelationCollection, IPrefetchPath, Int32, Int32)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodGetMulti(IPredicate, Int64, ISortExpression, IRelationCollection, IPrefetchPath, ExcludeIncludeFieldsList, Int32, Int32)
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodIndexOf(IEntity)
Returns index in the list of given IEntity object.
Public methodIndexOf(IEntityCore)
Returns index in the list of given entity.
(Inherited from IEntityCollectionCore.)
Public methodInsert(Int32, IEntity)
Inserts an IEntity on position Index
Public methodInsert(Int32, IEntityCore)
Inserts an IEntityCore on position Index
(Inherited from IEntityCollectionCore.)
Public methodPerformGetMulti
Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodPerformGetMultiAsync
Async variant of PerformGetMulti(QueryParameters). Retrieves in this Collection object all Entity objects which match with the specified filter, formulated in the predicate or predicate expression definition, using the passed in relations to construct the total query.
Public methodReadXml(String)
Will fill the entity collection and its containing members (recursively) with the data stored in the XmlNode passed in. The XmlNode has to be filled with Xml in the format written by IEntityCollection.WriteXml() and the Xml has to be compatible with the structure of this entity collection.
Public methodReadXml(XmlNode)
Will fill the entity collection and its containing members (recursively) with the data stored in the XmlNode passed in. The XmlNode has to be filled with Xml in the format written by IEntityCollection.WriteXml() and the Xml has to be compatible with the structure of this entity collection.
Public methodRemove(IEntity)
Remove given IEntity from the list.
Public methodRemove(IEntityCore)
Remove given IEntityCore instance from the list.
(Inherited from IEntityCollectionCore.)
Public methodSaveMulti
Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.). Will not recursively save entities inside the collection.
Public methodSaveMulti(Boolean)
Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.)
Public methodSaveMultiAsync
Async variant of SaveMulti. Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.). Will not recursively save entities inside the collection.
Public methodSaveMultiAsync(Boolean)
Async variant of SaveMulti(Boolean). Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.)
Public methodSaveMultiAsync(CancellationToken)
Async variant of SaveMulti. Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.)
Public methodSaveMultiAsync(Boolean, CancellationToken)
Async variant of SaveMulti(Boolean). Saves all new/dirty Entities in the IEntityCollection in the persistent storage. If this IEntityCollection is added to a transaction, the save processes will be done in that transaction, if the entity isn't already added to another transaction. If the entity is already in another transaction, it will use that transaction. If no transaction is present, the saves are done in a new Transaction (which is created in an inherited method.)
Public methodSetContainingEntityInfo
Sets the entity information of the entity object containing this collection. Call this method only from entity classes which contain IEntityCollection members, like 'Customer' which contains 'Orders' entity collection.
Public methodSort(Int32, ListSortDirection)
Applies sorting like IBindingList.ApplySort, on the field with the index fieldIndex and with the direction specified.
(Inherited from IEntityCollectionCore.)
Public methodSort(Int32, ListSortDirection, IComparerObject)
Sorts the collection.
(Inherited from IEntityCollectionCore.)
Public methodSort(String, ListSortDirection, IComparerObject)
Sorts the collection.
(Inherited from IEntityCollectionCore.)
Public methodUpdateMulti(IEntity, IPredicate)
Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodUpdateMulti(IEntity, IPredicate, IRelationCollection)
Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodUpdateMultiAsync(IEntity, IPredicate)
Async variant of UpdateMulti(IEntity, IPredicate). Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodUpdateMultiAsync(IEntity, IPredicate, IRelationCollection)
Async variant of UpdateMulti(IEntity, IPredicate, IRelationCollection). Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodUpdateMultiAsync(IEntity, IPredicate, CancellationToken)
Async variant of UpdateMulti(IEntity, IPredicate). Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodUpdateMultiAsync(IEntity, IPredicate, IRelationCollection, CancellationToken)
Async variant of UpdateMulti(IEntity, IPredicate, IRelationCollection). Updates in the persistent storage all entities of the type this collection is for which have data in common with the specified entity. Which fields are updated in those matching entities depends on which fields are changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues.
Public methodWriteXml(String)
Converts this entity collection to XML, recursively. Uses "EntityCollection" for the rootnode name
Public methodWriteXml(String, String)
Converts this entity collection to XML.
Public methodWriteXml(XmlDocument, XmlNode)
Converts this entity collection to XML. Uses "EntityCollection" for the rootnode name
Public methodWriteXml(XmlFormatAspect, String)
Converts this entity collection to XML, recursively. Uses "EntityCollection" for the rootnode name
Public methodWriteXml(String, XmlDocument, XmlNode)
Converts this entity collection to XML.
Public methodWriteXml(XmlFormatAspect, String, String)
Converts this entity collection to XML.
Public methodWriteXml(XmlFormatAspect, XmlDocument, XmlNode)
Converts this entity collection to XML. Uses "EntityCollection" for the rootnode name
Public methodWriteXml(XmlFormatAspect, String, XmlDocument, XmlNode)
Converts this entity collection to XML.
Top
Events
  NameDescription
Public eventEntityAdded
Event which is raised at the End of the Add or Insert(index) routine.
(Inherited from IEntityCollectionCore.)
Public eventEntityAdding
Event which is raised at the start of the Add or Insert(index) routine. To cancel the addition action, set cancel to true.
(Inherited from IEntityCollectionCore.)
Public eventEntityRemoved
Event which is raised at the End of the Remove or RemoveAt(index) routine.
(Inherited from IEntityCollectionCore.)
Public eventEntityRemoving
Event which is raised at the start of the Remove or RemoveAt(index) routine. To cancel the remove action, set cancel to true.
(Inherited from IEntityCollectionCore.)
Public eventListChanged
Event which is raised when the collection changed: an item changed, an item was removed, added, or the collection was cleared. If possible, use one of the Entity* events of this collection.
(Inherited from IEntityCollectionCore.)
Top
Extension Methods
  NameDescription
Public Extension MethodGetMultiTEntity
Fetches the query specified into the collection specified.
(Defined by SelfServicingExtensionMethods.)
Public Extension MethodGetMultiAsyncTEntity(EntityQueryTEntity)Overloaded. (Defined by SelfServicingExtensionMethods.)
Public Extension MethodGetMultiAsyncTEntity(EntityQueryTEntity, CancellationToken)Overloaded. (Defined by SelfServicingExtensionMethods.)
Top
See Also