UnitOfWork Class |
Namespace: SD.LLBLGen.Pro.ORMSupportClasses
The UnitOfWork type exposes the following members.
Name | Description | |
---|---|---|
UnitOfWork |
CTor
| |
UnitOfWork(ListUnitOfWorkBlockType) |
Initializes a new instance of the UnitOfWork class.
| |
UnitOfWork(SerializationInfo, StreamingContext) |
CTor for deserialization
|
Name | Description | |
---|---|---|
CommitOrder |
Gets / sets the Commit Order of the various blocks the unit of work groups the elements in.
| |
OptimizedSerialization |
Gets / sets the OptimizedSerialization flag. Default: true. When set to false, the serialization logic will simply serialize all entities inside the
unit of work. When set to true, the unit of work will first calculate the save queues, which weeds out entities which aren't changed and won't be
saved anyway, so these don't have to be sent over the wire.
|
Name | Description | |
---|---|---|
AddCallBack(Delegate, UnitOfWorkCallBackScheduleSlot, Object) |
Adds the call back passed in, to the slot specified with the parameters specified.
| |
AddCallBack(Delegate, UnitOfWorkCallBackScheduleSlot, Boolean, Object) |
Adds the call back passed in, to the slot specified with the parameters specified.
| |
AddCollectionForDelete |
Adds the collection with entities for deletion.
| |
AddCollectionForSave(IEntityCollection) |
Adds the collection with entities for saving.
| |
AddCollectionForSave(IEntityCollection, Boolean) |
Adds the collection with entities for saving.
| |
AddDeleteMultiCall(IEntityCollection, IPredicate) |
Adds a call to collection.DeleteMulti(filter) to delete entities directly from the database using the passed in
criteria. The call will be executed inside the transaction used in Commit and will be executed after the last entity has been
deleted but before the PostEntityDelete callbacks.
| |
AddDeleteMultiCall(IEntityCollection, IPredicate, IRelationCollection) |
Adds a call to collection.DeleteMulti(filter, relations) to delete entities directly from the database using the passed in
criteria. The call will be executed inside the transaction used in Commit and will be executed after the last entity has been
deleted but before the PostEntityDelete callbacks.
| |
AddForDelete(IEntity) |
Adds the passed in entity for deletion.
| |
AddForDelete(IEntity, IPredicate) |
Adds the passed in entity for deletion.
| |
AddForSave(IEntity) |
Adds the passed in entity for saving. No recursion will be applied during the save of this entity when the unit of work is committed.
| |
AddForSave(IEntity, IPredicate) |
Adds the passed in entity for saving. No recursion will be applied during the save of this entity when the unit of work is committed.
| |
AddForSave(IEntity, Boolean) |
Adds the passed in entity for saving.
| |
AddForSave(IEntity, IPredicate, Boolean) |
Adds the passed in entity for saving.
| |
AddUpdateMultiCall(IEntityCollection, IEntity, IPredicate) |
Adds a call to collection.UpdateMulti(Entity, filter) to update entities directly in the database using the passed in
criteria. The call will be executed inside the transaction used in Commit and will be executed after the last entity has been
updated but before the PreEntityUpdate callbacks.
| |
AddUpdateMultiCall(IEntityCollection, IEntity, IPredicate, IRelationCollection) |
Adds a call to collection.UpdateMulti(Entity, filter, relations) to update entities directly in the database using the passed in
criteria. The call will be executed inside the transaction used in Commit and will be executed after the last entity has been
updated but before the PreEntityUpdate callbacks.
| |
Commit(ITransaction) |
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
Commit(ITransaction, Boolean) |
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
CommitAsync(ITransaction) |
Async variant of Commit(ITransaction).
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
CommitAsync(ITransaction, Boolean) |
Async variant of Commit(ITransaction, Boolean).
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
CommitAsync(ITransaction, CancellationToken) |
Async variant of Commit(ITransaction).
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
CommitAsync(ITransaction, Boolean, CancellationToken) |
Async variant of Commit(ITransaction, Boolean).
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes.
| |
ConstructSaveProcessQueues |
Constructs the save process queues for insert and update actions. These queues are constructed from the entities added to this UoW
for save either individually or in a collection. Call this method to determine what the sequence will be for the insert and update
actions executed during Commit(). Commit() uses this method as well as well as the serialization/deserialization logic, to avoid
sending large object graphs with few changes.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetCollectionElementsToDelete |
Gets the UnitOfWorkCollectionElements with the collections which are added with AddCollectionForDelete, in a new List.
To remove a collection, call RemoveCollectionFromUoW(IEntityCollection) | |
GetCollectionElementsToSave |
Gets the UnitOfWorkCollectionElement objects with the collections which are added with AddCollectionForSave, in a new List
To remove a collection, call RemoveCollectionFromUoW(IEntityCollection) | |
GetEntityElementsToDelete |
Gets the UnitOfWorkElements with the entities which are added with AddForDelete, in a new list.
To remove an entity, call RemoveFromUoW(IEntity) | |
GetEntityElementsToInsert |
Gets the UnitOfWorkElements with the entities which are added with AddForSave and which are new.
To remove an entity, call RemoveFromUoW(IEntity) | |
GetEntityElementsToUpdate |
Gets the UnitOfWorkElements with the entities which are added with AddForSave and which are not new .
To remove an entity, call RemoveFromUoW(IEntity) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetInsertQueue |
Gets the insert queue, which is a list of ActionQueueElements(of IEntity) which have been placed in the insert queue.
This queue is empty unless ConstructSaveProcessQueues has been called, or Commit has been called, which calls
ConstructSaveProcessQueues under the hood. If this method is called after Commit, and Commit succeeded, the
entities in the queue returned are saved succesfully. Calling Reset will not clear the queues, only ConstructSaveProcessQueues
or Commit will.
| |
GetObjectData |
Gets the object data.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUpdateQueue |
Gets the update queue, which is a list of ActionQueueElements(of IEntity) which have been placed in the update queue.
This queue is empty unless ConstructSaveProcessQueues has been called, or Commit has been called, which calls
ConstructSaveProcessQueues under the hood. If this method is called after Commit, and Commit succeeded, the
entities in the queue returned are saved succesfully. Calling Reset will not clear the queues, only ConstructSaveProcessQueues
or Commit will.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RemoveCollectionFromUoW |
Removes the specified entity collection from this UnitOfWork.
| |
RemoveFromUoW |
Removes the specified entity from this UnitOfWork. If the entity is in an added collection, the entity will later on still be added.
| |
Reset |
Resets the inner contents of this unit of work.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
IUnitOfWorkCoreAddCollectionForDelete |
Adds the collection with entities for deletion.
| |
IUnitOfWorkCoreAddCollectionForSave(IEntityCollectionCore) |
Adds the collection with entities for saving. No recursion and no refetch are done for these entities.
| |
IUnitOfWorkCoreAddCollectionForSave(IEntityCollectionCore, Boolean, Boolean) |
Adds the collection with entities for saving.
| |
IUnitOfWorkCoreAddForDelete |
Adds the passed in entity for deletion.
| |
IUnitOfWorkCoreAddForSave(IEntityCore) |
Adds the passed in entity for saving. No refetching will be applied. Save is recursive.
| |
IUnitOfWorkCoreAddForSave(IEntityCore, Boolean) |
Adds the passed in entity for saving. No refetching will be applied. Save is recursive.
| |
IUnitOfWorkCoreCommit(ITransactionController) |
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes. This order can be controlled by the
constructor of the unit of work which allows users to define a different work order.
| |
IUnitOfWorkCoreCommit(ITransactionController, Boolean) |
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes. This order can be controlled by the
constructor of the unit of work which allows users to define a different work order.
| |
IUnitOfWorkCoreCommitAsync |
Async variant of Commit(ITransactionController)
Commits this unit of work. It will first add all entities in the added collections to the correct bins, then it will start
by first inserting all new entities, then saving all updates and then performing the deletes. This order can be controlled by the
constructor of the unit of work which allows users to define a different work order.
| |
IUnitOfWorkCoreReset |
Resets the inner contents of this Unit of work object
|