Click or drag to resize

EntityCollectionBase2TEntity Class

Implementation of the entity collection base class.
Inheritance Hierarchy
SystemObject
  SD.LLBLGen.Pro.ORMSupportClassesCollectionCoreTEntity
    SD.LLBLGen.Pro.ORMSupportClassesEntityCollectionBase2TEntity
      SD.LLBLGen.Pro.ORMSupportClassesEntityCollectionNonGeneric

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.10.0.0 (5.10.0)
Syntax
[SerializableAttribute]
public abstract class EntityCollectionBase2<TEntity> : CollectionCore<TEntity>, 
	IXmlSerializable, IListSource, IEntityCollection2, IEntityCollectionCore, IActiveContextParticipant, 
	IEnumerable, IOwnedDataSerializable
where TEntity : EntityBase2, IEntity2

Type Parameters

TEntity

The EntityCollectionBase2TEntity type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyActiveContext
Gets / sets the active context this entity collection is in. Setting this property is not adding the entity collection to the context, it will make contained entities be added to the passed in context. If the entity collection 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 entity collections.
(Inherited from CollectionCoreT.)
Public propertyAllowEdit
Default: true. If set to false, entities inside this collection won't be editable in a complex databinding scenario.
(Inherited from CollectionCoreT.)
Public propertyAllowNew
Default: true. If set to false, no new entities will be added through databinding.
(Inherited from CollectionCoreT.)
Public propertyAllowRemove
Default: false. If set to true, entities can be removed through databinding.
(Inherited from CollectionCoreT.)
Public propertyCapacity
Gets / sets the initial capacity of the entity collection.
(Inherited from CollectionCoreT.)
Public propertyConcurrencyPredicateFactoryToUse
Gets / sets the IConcurrencyPredicateFactory instance to use when creating entity objects during a GetMulti() call or when AddNew is called.
(Inherited from CollectionCoreT.)
Protected propertyContainingEntity
Gets the entity which contains this collection (e.g. Customer, if this collection is the Customer's Orders collection), or null if this collection isn't part of any entity.
Protected 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 CollectionCoreT.)
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 propertyContainsListCollection
Gets a value indicating whether the collection is a collection of IList objects.
Public propertyCount (Inherited from CollectionCoreT.)
Public propertyDefaultView
Gets the default view for this entitycollection. The returned value is the same instance every time this property is read. It's an entity view without a filter or a sorter.
Protected propertyDeserializationInProgress
Gets or sets a value indicating whether [deserialization in progress].
(Inherited from CollectionCoreT.)
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.
(Inherited from CollectionCoreT.)
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) this check is not performed. Setting this property to true can slow down fetch logic.
(Inherited from CollectionCoreT.)
Public propertyEntityFactoryToUse
The EntityFactory2 to use when creating entity objects when bound to a grid and AddNew is enabled.
Protected propertyEntityFactoryToUseInternal
Gets or sets the entity factory to use
(Overrides CollectionCoreTEntityFactoryToUseInternal.)
Public propertyEntityValidatorToUse Obsolete.
Obsolete. Collections don't store validator objects anymore. Present to make sure users can continue designing their forms in vs.net
(Inherited from CollectionCoreT.)
Public propertyIsReadOnly (Inherited from CollectionCoreT.)
Public propertyItem
Gets or sets the object at the specified index.
(Inherited from CollectionCoreT.)
Public propertyItems
Items contained by this collection. Returns simply this instance.
(Inherited from CollectionCoreT.)
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.
Protected propertyRemovedEntitiesTrackerInternal
Gets or sets the removal tracker internal.
(Overrides CollectionCoreTRemovedEntitiesTrackerInternal.)
Public propertySite
Gets or sets the ISite associated with the IComponent.
(Inherited from CollectionCoreT.)
Protected propertySuppressListChangedEventsInternal
Gets or sets a value indicating whether [surpress list changed events].
(Inherited from CollectionCoreT.)
Public propertyValidatorToUse Obsolete.
Obsolete. Collections don't store validator objects anymore. Present to make sure users can continue designing their forms in vs.net
(Inherited from CollectionCoreT.)
Top
Methods
  NameDescription
Public methodAdd (Inherited from CollectionCoreT.)
Protected methodAddContainedEntitiesToContext
Adds the contained entities to the active set context.
(Inherited from CollectionCoreT.)
Public methodAddNew
Will add a new entity to the list, will set its parent collection property so CancelEdit will remove it from the list again, and will set its flag that it is added by databinding.
(Overrides CollectionCoreTAddNew.)
Public methodAddRange
Adds the range of objects passed in.
(Inherited from CollectionCoreT.)
Public methodClear (Inherited from CollectionCoreT.)
Public methodClear(Boolean) (Inherited from CollectionCoreT.)
Public methodContains (Inherited from CollectionCoreT.)
Public methodCopyTo (Inherited from CollectionCoreT.)
Protected methodCreateDefaultEntityView
Creates the default entity view instance. By default it creates a new EntityView2(Of TEntity) instance, passing in this collection.
Public methodCreateHierarchicalProjection(DictionaryType, IEntityCollection2)
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, IEntityCollection2)
Creates a hierarchical projection of all the data in this view and for each type in the complete graph found starting with each entity in this view, using the viewProjections 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 EntityView2 object of the right type on this collection with no filter nor sorter applied.
Public methodCreateView(IPredicate)
Creates a new EntityView2 object of the right type on this collection with the passed in filter applied
Public methodCreateView(IPredicate, ISortExpression)
Creates a new EntityView2 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 EntityView2 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.
Protected methodDeserializeOwnedData
Method which restores owned data - i.e. considered private to this entity and not shared with any external object
Public methodDispose
Disposes this instance.
(Inherited from CollectionCoreT.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
(Inherited from CollectionCoreT.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindMatches
Gets all indices of all the entities in the current order of this collection which match the passed in filter.
(Inherited from CollectionCoreT.)
Protected methodGetEntityDescription
Gets the entity description for the entity passed in.
(Overrides CollectionCoreTGetEntityDescription(T, Boolean).)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from CollectionCoreT.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetList
Returns an IList that can be bound to a data source from an object that does not implement an IList itself.
Public methodGetObjectData
ISerializable member.
(Overrides CollectionCoreTGetObjectData(SerializationInfo, StreamingContext).)
Public methodGetSchema
Produce the schema, always return null, as the XmlSerializer object otherwise can't handle our code.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf (Inherited from CollectionCoreT.)
Protected methodInitCoreClass
Inits the core class.
(Inherited from CollectionCoreT.)
Public methodInsert (Inherited from CollectionCoreT.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDeserialized
Called at the end of the deserialization constructor. Method is used when this object is deserialized. Override this method to tap into the deserialization sequence. (binary/soap formatter specific).
(Inherited from CollectionCoreT.)
Protected methodOnEntityAdded
Called at the end of the Add or Insert routine which adds an entity to this collection. Will raise EntityAdded event.
(Inherited from CollectionCoreT.)
Protected methodOnEntityAdding
Called at the start of the Add or Insert routine which adds an entity to this collection. Will raise EntityAdding event.
(Inherited from CollectionCoreT.)
Protected methodOnEntityInListOnEntityContentsChanged
Event handler for the EntityContentsChanged event.
(Inherited from CollectionCoreT.)
Protected methodOnEntityRemoved
Called at the end of a remove routine which removes an entity from this collection. Will raise EntityRemoved event.
(Inherited from CollectionCoreT.)
Protected methodOnEntityRemoving
Called at the start of a remove routine which removes an entity from this collection. Will raise EntityRemoving event.
(Inherited from CollectionCoreT.)
Protected methodOnGetObjectData
Called at the end of GetObjectData. Method is used when this object is serialized. Override this method to tap into the serialization sequence. (binary/soap formatter specific).
(Inherited from CollectionCoreT.)
Protected methodOnListChanged
Called when [list changed].
(Inherited from CollectionCoreT.)
Protected methodPerformAddToActiveContext
Performs the add action to the active context for this collection
(Inherited from CollectionCoreT.)
Protected methodPerformSetRelatedEntity
Performs the set related entity action on the passed in entity. This action is delegated to an inheritor.
(Overrides CollectionCoreTPerformSetRelatedEntity(T).)
Protected methodPerformUnsetRelatedEntity
Performs the unset related entity action on the passed in entity. This action is delegated to an inheritor.
(Overrides CollectionCoreTPerformUnsetRelatedEntity(T).)
Protected methodPlaceInRemovedEntitiesTracker
Places the item in the set RemovedEntitiesTracker.
(Overrides CollectionCoreTPlaceInRemovedEntitiesTracker(T, Boolean).)
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 IEntityCollection2.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 IEntityCollection2.WriteXml() and the Xml has to be compatible with the structure of this entity collection.
Public methodReadXml(XmlReader)
Constructs an object graph with this object as the root from the xml contained by the passed in XmlReader object.
Public methodReadXml(XmlReader, XmlFormatAspect)
Constructs an object graph with this object as the root from the xml contained by the passed in XmlReader object.
Public methodRemove (Inherited from CollectionCoreT.)
Public methodRemoveAt (Inherited from CollectionCoreT.)
Public methodRemoveRange
Removes the elements in the range specified from this collection.
(Inherited from CollectionCoreT.)
Protected methodSerializeOwnedData
Method which restores owned data - i.e. considered private to this collection and not shared with any external object
Public methodSetContainingEntityInfo
Sets the entity information of the entity object containing this collection. Call this method only from entity classes which contain EntityCollection members, like 'Customer' which contains 'Orders' entity collection.
Protected methodSilentRemove
Removes the passed in entity from the collection without notifying the entity to remove that it has been removed from this collection.
(Inherited from CollectionCoreT.)
Public methodSort(Int32, ListSortDirection)
Applies sorting like IBindingList.ApplySort, on the field with the index fieldIndex and with the direction specified.
(Inherited from CollectionCoreT.)
Protected methodSort(PropertyDescriptor, ListSortDirection, IComparerObject)
Sorts the collection.
(Inherited from CollectionCoreT.)
Public methodSort(String, ListSortDirection, IComparerObject)
Sorts the collection.
(Inherited from CollectionCoreT.)
Public methodSort(Int32, ListSortDirection, IComparerObject)
Sorts the collection.
(Overrides CollectionCoreTSort(Int32, ListSortDirection, IComparerObject).)
Public methodToString
Returns a String that represents the current Object.
(Inherited from CollectionCoreT.)
Public methodWriteXml(String)
Converts this entity collection to XML, recursively. Uses "EntityCollection" for the rootnode name
Public methodWriteXml(XmlWriter)
Constructs the XML output from the object graph which has this object as the root.
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(XmlWriter, XmlFormatAspect)
Converts this entity collection to XML
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(XmlWriter, XmlFormatAspect, String)
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 eventDisposed
IComponent's Disposed event.
(Inherited from CollectionCoreT.)
Public eventEntityAdded
Event which is raised at the End of the Add or Insert(index) routine.
(Inherited from CollectionCoreT.)
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 CollectionCoreT.)
Public eventEntityRemoved
Event which is raised at the End of the Remove or RemoveAt(index) routine.
(Inherited from CollectionCoreT.)
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 CollectionCoreT.)
Public eventListChanged
Event which is used in complex databinding.
(Inherited from CollectionCoreT.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIListAdd
Adds an item to the IList.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIListClear (Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIListContains
Determines whether the IList contains a specific value.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodICollectionCopyTo
Copies the elements of the ICollection to an Array, starting at a particular Array index.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyICollectionCount (Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIListIndexOf
Determines the index of a specific item in the IList.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIListInsert
Inserts an item to the IList at the specified index.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIListIsFixedSize
Gets a value indicating whether the IList has a fixed size.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIListIsReadOnly (Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyICollectionIsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIListItem
Gets or sets the Object at the specified index.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIXmlSerializableReadXml
Constructs an object graph with this object as the root from the xml contained by the passed in XmlReader object.
Explicit interface implementationPrivate methodIListRemove
Removes the first occurrence of a specific object from the IList.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIListRemoveAt (Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyICollectionSyncRoot
Gets an object that can be used to synchronize access to the ICollection.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollection2Add
Adds an IEntity2 object to the list.
Explicit interface implementationPrivate methodIEntityCollection2AddRange
Adds the range of objects passed in. Objects have to be IEntity2 implementing objects
Explicit interface implementationPrivate propertyIEntityCollection2Capacity
Gets / sets the initial capacity of the entity collection.
Explicit interface implementationPrivate methodIEntityCollection2Contains
Returns true if the list contains the given IEntity2 Object
Explicit interface implementationPrivate methodIEntityCollection2CopyTo
copy the complete list of IEntity2 objects to an array of IEntity objects.
Explicit interface implementationPrivate methodIEntityCollection2CreateHierarchicalProjection(ListIViewProjectionData, DictionaryType, IEntityCollection2)
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.
Explicit interface implementationPrivate methodIEntityCollection2CreateHierarchicalProjection(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.
Explicit interface implementationPrivate methodIEntityCollection2CreateView
Creates a new EntityView2 object of the right type on this collection with no filter nor sorter applied.
Explicit interface implementationPrivate methodIEntityCollection2CreateView(IPredicate)
Creates a new EntityView2 object of the right type on this collection with the passed in filter applied
Explicit interface implementationPrivate methodIEntityCollection2CreateView(IPredicate, ISortExpression)
Creates a new EntityView2 object of the right type on this collection with the passed in filter and sorter applied to it.
Explicit interface implementationPrivate methodIEntityCollection2CreateView(IPredicate, ISortExpression, PostCollectionChangeAction)
Creates a new EntityView2 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.
Explicit interface implementationPrivate propertyIEntityCollection2DefaultView
Gets the default view for this entitycollection. The returned value is a new instance every time this property is read. It's a new entity view without a filter or a sorter.
Explicit interface implementationPrivate propertyIEntityCollection2DirtyEntities
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.
Explicit interface implementationPrivate methodIEntityCollection2IndexOf
Returns index in the list of given IEntity2 object.
Explicit interface implementationPrivate methodIEntityCollection2Insert
Inserts an IEntity2 on position Index
Explicit interface implementationPrivate propertyIEntityCollection2Item
Gets or sets the IEntity2 at the specified index.
Explicit interface implementationPrivate methodIEntityCollection2Remove
Remove given IEntity2 instance from the list.
Explicit interface implementationPrivate methodIEntityCollectionCoreAdd
Adds an IEntityCore object to the list.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreClear
Clears the collection
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreClear(Boolean)
Clears the collection
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreContainingEntityMappedField
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 CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreContains
Returns true if the list contains the given entity
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreEntityFactoryToUse
The EntityFactory to use when creating entity objects during fetch action or other logic which requires the creation of new entities.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreFindMatches
Gets all indices of all the entities in the current order of this collection which match the passed in filter.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreIndexOf
Returns index in the list of given entity.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreInsert
Inserts an IEntityCore on position Index
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreIsForMN
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 CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreIsRemovalTracker
Gets or sets a value indicating whether this instance is a removal tracker collection.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreItem
Simple indexer.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIEntityCollectionCoreRemove
Remove given IEntityCore instance from the list.
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate propertyIEntityCollectionCoreRemovedEntitiesTracker
Gets or sets the removal tracker for this entity collection
(Inherited from CollectionCoreT.)
Explicit interface implementationPrivate methodIOwnedDataSerializableDeserializeOwnedData
Lets the implementing class retrieve internal data directly from a SerializationReader.
Explicit interface implementationPrivate methodIOwnedDataSerializableSerializeOwnedData
Lets the implementing class store internal data directly into a SerializationWriter.
Top
See Also