adTempus API
ArcanaDevelopment.adTempus.Client Namespace / UnitOfWork Class
Members


In This Topic
    UnitOfWork Class
    In This Topic
    A UnitOfWork is a group of object saves and deletions that are sent to the server in one call and executed in one transaction
    Syntax
    'Declaration
     
    
    Public Class UnitOfWork 
    public class UnitOfWork 
    public ref class UnitOfWork 
    Remarks

    Use a UnitOfWork to perform atomic updates and deletions on adTempus objects. All operations added to the UnitOfWork are sent to the server in a single call, and the object validation and database updates are performed in a single transaction, so that if any of the operations fail none will be committed.

    After adding operations to the UnitOfWork using AddForSave and AddForDelete, call Commit to commit the changes to the server. To discard the changes without saving, simply discard the UnitOfWork: there is no explicit rollback method.

    If you want to reuse a UnitOfWork that has bot been committed, call Clear first to empty it.

    The order in which actions are added to the UnitOfWork does not matter: the server will sequence actions properly based on dependencies.

    Use DataContext.CreateUnitOfWork to create a new UnitOfWork.

    A UnitOfWork can only contain objects that belong to the same DataContext as the UnitOfWork. If you try to add an object from another DataContext you will get a BoundaryViolationException

    Inheritance Hierarchy

    System.Object
       ArcanaDevelopment.adTempus.Client.UnitOfWork

    See Also