public void Intercept(IInvocation invocation) { if (Uow == null) { invocation.Proceed(); return; } var method = invocation.MethodInvocationTarget; if (method != null && method.GetCustomAttribute <TransactionalAttribute>() != null) { Uow.BeginTransaction(); } else { invocation.Proceed(); return; } var callMethodSuccess = true; try { invocation.Proceed(); } catch (Exception e) { callMethodSuccess = false; Uow.RollBack(); Logger.LogDebug(e.Message); } if (callMethodSuccess && method.GetCustomAttribute <TransactionalAttribute>() != null) { Uow.Commit(); } }