Click or drag to resize

EntitySetTEntity Class

This class holds and manages a collection of tracked entities. All interactions with instances of this class must happen inside a Transaction, guaranteeing snapshot isolation.
Inheritance Hierarchy

Namespace:  AGI.Foundation.Tracking
Assembly:  AGI.Foundation.Tracking (in AGI.Foundation.Tracking.dll) Version: 22.2.414.0 (22.2.414.0)
public class EntitySet<TEntity>
where TEntity : class, IEntityIdentifier

Type Parameters

The type of entity in the set.

The EntitySetTEntity type exposes the following members.

Public propertyContext
Gets the context used for transactions on this entity set.
Public propertyOwner
Gets the owner of this entity set.
Public methodAdd
Adds an entity.
Public methodClear
Removes all entities from this entity set.
Public methodEnsure
Ensures that the entity with a specified EntityIdentifier is not removed or replaced with a different entity with the same identifier before a transaction is committed. If another transaction commits first and removes or replaces the entity, the transaction will raise a TransactionConflictException when it is committed. It is valid to call this method with an id that is not present in the entity set. In that case, a TransactionConflictException will be thrown if an entity with id is added to the entity set in another transaction.
Public methodEnsureAll
Ensures that the entity set does not change at all before the transaction is committed. If another transaction commits first and makes any changes to the entity set at all, this transaction will raise a TransactionConflictException when it is committed.
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 methodGetCount
Gets the number of entities in this entity set.
Public methodGetEntities
Gets a read-only collection of all the entities in the entity set.
Public methodGetEntityById
Gets the entity with the given EntityIdentifier.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove(Transaction, TEntity)
Removes an entity.
Public methodRemove(Transaction, Object)
Removes an entity.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public eventChanged
Raised when entities are added to or removed from this entity set.
See Also