Пример #1
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            using (var trxScope = new TransactionScope())
            {
                interceptionContext.Proceed();

                trxScope.Complete();
            }
        }
Пример #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;
 }
Пример #5
0
 public override void AfterInvoke(IInterceptionContext interceptionContext, object methodResult)
 {
     Console.WriteLine($"Method executed: {interceptionContext.CurrentMethod.Name}");
 }
Пример #6
0
 public override void BeforeInvoke(IInterceptionContext interceptionContext)
 {
     Console.WriteLine($"Method executing: {interceptionContext.CurrentMethod.Name}");
 }
Пример #7
0
        public void Intercept(IInterceptionContext interceptionContext)
        {
            interceptionContext.Proceed();

            proxyContainer.DisposeProxies();
        }