Exemplo n.º 1
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            using (var trxScope = new TransactionScope())
            {
                interceptionContext.Proceed();

                trxScope.Complete();
            }
        }
Exemplo n.º 2
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            try
            {
                interceptionContext.Proceed();
            }
            catch (Exception e)
            {
                logger.LogError(e.Message);

                throw;
            }

            logger.Log($"Method {interceptionContext.MethodName} of type {interceptionContext.TargetType.FullName} invoked", LogLevel.All);
        }
        public void Intercept(IInterceptionContext interceptionContext)
        {
            if (!unitOfWork.IsStarted)
            {
                unitOfWork.Begin();
            }

            try
            {
                interceptionContext.Proceed();
            }
            catch
            {
                unitOfWork.Rollback();

                throw;
            }

            unitOfWork.Commit();
        }
Exemplo n.º 4
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            interceptionContext.Proceed();

            proxyContainer.DisposeProxies();
        }