예제 #1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.Controller.ViewData.ModelState.IsValid && filterContext.HttpContext.Error == null)
            {
                if (Behaviour == null)
                    Behaviour = TransactionalBehaviour.RequiresNew;

                if (IsolationLevel == null)
                    IsolationLevel = IsolationLevel.ReadCommitted;
                transactionScopeHandler = new TransactionScopeHandler(Behaviour, IsolationLevel, new TimeSpan(0, 0, 0));
                transactionScopeHandler.InitScope();
            }
            base.OnActionExecuting(filterContext);
        }
예제 #2
0
        /// <summary>
        /// Crea un ámbito de transacción en base a la configuración del servicio de negocio.
        /// </summary>
        /// <param name="serviceConfiguration">configuración del servicio de negocio.</param>
        /// <returns>ámbito de transacción. <see cref="TransactionScopeHandler"/> </returns>
        /// <date>2008-04-07T00:00:00</date>
        /// <author>moviedo</author>
        private static TransactionScopeHandler CreateTransactionScopeHandler(ServiceConfiguration serviceConfiguration)
        {
            //Creación del ámbito de la transacción.
            TransactionScopeHandler wResult = new TransactionScopeHandler(serviceConfiguration.TransactionalBehaviour, serviceConfiguration.IsolationLevel, new TimeSpan(0, 0, 0));

            return wResult;

        }