Beispiel #1
0
        public virtual object Invoke(InterceptorContext context)
        {
            object returnValue = context.Invoke();

            Console.WriteLine(string.Format("processed, return value: {0}", returnValue));
            return(returnValue);
        }
        public virtual object Invoke(InterceptorContext context)
        {
            TransactionAttribute transAttr = (context.TargetMethodInfo.GetCustomAttributes(typeof(TransactionAttribute), true) as TransactionAttribute[])[0];

            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = transAttr.IsolationLevel;
            options.Timeout        = transAttr.TimeOut;
            using (TransactionScope tran = new TransactionScope(transAttr.ScopeOption, options, transAttr.EnterpriseServicesInteropOption))
            {
                object returnValue = context.Invoke();
                tran.Complete();
                return(returnValue);
            }
        }
Beispiel #3
0
 public object Invoke(InterceptorContext context)
 {
     return(context.Invoke());
 }