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); } }
public object Invoke(InterceptorContext context) { return(context.Invoke()); }