public AdoNetUnitOfWorkScope(AdoNetUnitOfWork unitOfWork, SqlDialect dialect, IDbConnection connection)
		{
			if (unitOfWork == null) throw new ArgumentNullException(nameof(unitOfWork));

			_unitOfWork = unitOfWork;
			Dialect = dialect;
			Connection = connection;

			_log.Debug("Created new instance: {0} (UnitOfWork: {1})", GetHashCode(), unitOfWork.GetHashCode());
		}
		public IUnitOfWork Create()
		{
			var context = MessageContext.GetCurrent();
			var result = new AdoNetUnitOfWork(_factory, context);
			// Remove from context on disposal..
			//result.OnDispose += () => context.Items.Remove(CONTEXT_ITEM_KEY);
			context.Items.Add(CONTEXT_ITEM_KEY, result);

			return result;
		}
예제 #3
0
        public IUnitOfWork Create()
        {
            var context = MessageContext.GetCurrent();
            var result  = new AdoNetUnitOfWork(_factory, context);

            // Remove from context on disposal..
            //result.OnDispose += () => context.Items.Remove(CONTEXT_ITEM_KEY);
            context.Items.Add(CONTEXT_ITEM_KEY, result);

            return(result);
        }
예제 #4
0
        public AdoNetUnitOfWorkScope(AdoNetUnitOfWork unitOfWork, SqlDialect dialect, IDbConnection connection)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException(nameof(unitOfWork));
            }

            _unitOfWork = unitOfWork;
            Dialect     = dialect;
            Connection  = connection;

            _log.Debug("Created new instance: {0} (UnitOfWork: {1})", GetHashCode(), unitOfWork.GetHashCode());
        }