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(); } }
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()); }
public static T[] GetAttributes <T>(this IInvocation invocation) { var attrs = invocation.GetMethod().GetCustomAttributes(true).OfType <T>().ToArray(); return(attrs); }