Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EfUnitOfWork"/> class.
        /// </summary>
        /// <param name="ambientContextManager">The transaction manager.</param>
        /// <param name="dbContextContainer">The context container.</param>
        /// <param name="parent">The parent.</param>
        /// <remarks></remarks>
        protected internal EfUnitOfWork(AmbientContextManagerBase ambientContextManager, IDbContextContainer dbContextContainer, UnitOfWorkBase parent)
            : base(ambientContextManager, parent)
        {
            if (dbContextContainer == null)
            {
                throw new ArgumentNullException("dbContextContainer");
            }

            _DbContextContianer = dbContextContainer;
        }
Exemplo n.º 2
0
        protected UnitOfWorkBase(AmbientContextManagerBase ambientContextManager, UnitOfWorkBase parent, TransactionOptions transactionOptions)
        {
            ValidateTransactionOptions(parent, transactionOptions);

            _Id = Guid.NewGuid();
            _AmbientContextManager = ambientContextManager;
            _Parent                  = parent;
            _TransactionOptions      = transactionOptions;
            _ScopeThread             = Thread.CurrentThread;
            _Status                  = TransactionStatus.InDoubt;
            _ScopeTransactionFactory =
                new Lazy <Transaction>(
                    _Parent == null
                        ? (Func <Transaction>)(() => new CommittableTransaction(TransactionOptions))
                        : (Func <Transaction>)(() => _Parent.ScopeTransaction));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EfUnitOfWork"/> class.
 /// </summary>
 /// <param name="ambientContextManager">The transaction manager.</param>
 /// <param name="dbContextContainer">The context container.</param>
 /// <remarks></remarks>
 protected internal EfUnitOfWork(AmbientContextManagerBase ambientContextManager, IDbContextContainer dbContextContainer)
     : this(ambientContextManager, dbContextContainer, null)
 {
 }
Exemplo n.º 4
0
 protected UnitOfWorkBase(AmbientContextManagerBase ambientContextManager, TransactionOptions transactionOptions)
     : this(ambientContextManager, null, transactionOptions)
 {
 }
Exemplo n.º 5
0
 protected UnitOfWorkBase(AmbientContextManagerBase ambientContextManager, UnitOfWorkBase parent)
     : this(ambientContextManager, parent, new TransactionOptions())
 {
 }
Exemplo n.º 6
0
 public NonAtomicUnitOfWork(AmbientContextManagerBase ambientContextManager)
     : base(ambientContextManager)
 {
 }
Exemplo n.º 7
0
 protected UnitOfWorkBase(AmbientContextManagerBase ambientContextManager)
     : this(ambientContextManager, null, new TransactionOptions())
 {
 }
Exemplo n.º 8
0
 public NonAtomicUnitOfWork(AmbientContextManagerBase ambientContextManager)
     : base(ambientContextManager)
 {
 }
Exemplo n.º 9
0
 protected internal CompositeUnitOfWork(AmbientContextManagerBase ambientContextManager, UnitOfWorkBase parent, PersistenceOptions persistenceOptions)
     : base(ambientContextManager, parent, persistenceOptions.TransactionOptions)
 {
     _PersistenceOptions = persistenceOptions;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeUnitOfWork" /> class.
 /// </summary>
 /// <param name="ambientContextManager">The ambient context manager.</param>
 /// <param name="parent">The parent.</param>
 public CompositeUnitOfWork(AmbientContextManagerBase ambientContextManager, UnitOfWorkBase parent)
     : this(ambientContextManager, parent, new PersistenceOptions())
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeUnitOfWork" /> class.
 /// </summary>
 /// <param name="ambientContextManager">The ambient context manager.</param>
 /// <param name="persistenceOptions">The persistence options.</param>
 public CompositeUnitOfWork(AmbientContextManagerBase ambientContextManager, PersistenceOptions persistenceOptions)
     : this(ambientContextManager, null, persistenceOptions)
 {
 }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeUnitOfWork" /> class.
 /// </summary>
 /// <param name="ambientContextManager">The ambient context manager.</param>
 public CompositeUnitOfWork(AmbientContextManagerBase ambientContextManager)
     : this(ambientContextManager, null, new PersistenceOptions())
 {
 }