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();
        }
 void LoadNewContext()
 {
     DestroyContext();
     context = plugin.GetInterceptionContext(new InterceptionServiceProvider());
     context.OnNewMessageIntercepted += OnNewMessageIntercepted;
 }
Exemplo n.º 5
0
 public override void AfterInvoke(IInterceptionContext interceptionContext, object methodResult)
 {
     Console.WriteLine($"Method executed: {interceptionContext.CurrentMethod.Name}");
 }
Exemplo n.º 6
0
 public override void BeforeInvoke(IInterceptionContext interceptionContext)
 {
     Console.WriteLine($"Method executing: {interceptionContext.CurrentMethod.Name}");
 }
Exemplo n.º 7
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            interceptionContext.Proceed();

            proxyContainer.DisposeProxies();
        }