public void Intercept(IInvocation invocation)
        {
            var method = invocation.GetMethod();

            CheckPermission(method);

            using (var uow = _unitOfWorkMananger.Begin(method.GetIsolationLevel()))
            {
                uow.SetSiteId(Session.GetSiteId());
                uow.Begin();
                invocation.Proceed();
                uow.Complete();
            }
        }
예제 #2
0
        public void Intercept(IInvocation invocation)
        {
            try
            {
                var method = invocation.GetMethod();

                CheckPermission(method);

                using (var uow = _unitOfWorkMananger.Begin(method.GetIsolationLevel()))
                {
                    uow.SetSiteId(Session.GetSiteId());
                    invocation.Proceed();
                    uow.Complete();
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                throw e;
            }
        }
 public static IsolationLevel GetIsolationLevel(this IInvocation invocation)
 {
     return(invocation.GetMethod().GetIsolationLevel());
 }
예제 #4
0
        public static T[] GetAttributes <T>(this IInvocation invocation)
        {
            var attrs = invocation.GetMethod().GetCustomAttributes(true).OfType <T>().ToArray();

            return(attrs);
        }