Example #1
0
        /// <summary>
        /// Overloaded Constructor.
        /// Creates a new instance of the <see cref="UnitOfWorkScope"/> class.
        /// </summary>
        /// <param name="mode">A <see cref="TransactionMode"/> enum specifying the transation mode
        /// of the unit of work.</param>
        public UnityUnitOfWorkScope(IUnityUnitOfWorkManager manager, TransactionMode mode, CustomUnitOfWorkSettings settings)
        {
            //Guard.Against<ArgumentNullException>(container == null, "Ошибка создания UnityUnitOfWorkScope: не определен Unity-контейнер");
            Guard.Against <ArgumentNullException>(settings == null, "Ошибка создания UnityUnitOfWorkScope: не определены Settings");

            _manager = manager;
            //Container = container;
            _autoCompleteScope = settings.AutoCompleteScope;
            //UnitOfWorkManager.CurrentTransactionManager.EnlistScope(this, mode);
            //Container.Resolve<ITransactionManager>().EnlistScope(this, mode);
            _manager.CurrentTransactionManager().EnlistScope(this, mode);
        }
        public UnityEFRepository(IUnityContainer container, IUnityUnitOfWorkManager manager)
        {
            Guard.Against <ArgumentNullException>(container == null, "Ошибка создания репозитория для EF: не задан исходный Unity-контейнер");
            Container = container;
            _manager  = manager;
            var sessions = Container.ResolveAll <IEFSession>();

            if (sessions != null && sessions.Count() > 0)
            {
                _privateSession = sessions.First();
            }
        }
Example #3
0
 public BusinessTransactionSubjectWrapper(IUnityUnitOfWorkManager manager)
 {
     _manager = manager;
 }
Example #4
0
        //IUnityContainer Container { set; get; }

        /// <summary>
        /// Default Constuctor.
        /// Creates a new <see cref="UnitOfWorkScope"/> with the <see cref="System.Data.IsolationLevel.Serializable"/>
        /// transaction isolation level.
        /// </summary>
        public UnityUnitOfWorkScope(IUnityUnitOfWorkManager manager, CustomUnitOfWorkSettings settings)
            : this(manager, TransactionMode.Default, settings)
        {
        }