mirror of https://github.com/abpframework/abp
parent
ed53a95e12
commit
370d0e3b1c
@ -1,16 +1,24 @@
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DynamicProxy;
|
||||
using Volo.Abp.TestBase.Logging;
|
||||
using Volo.DependencyInjection;
|
||||
|
||||
namespace Volo.Abp.Castle.DynamicProxy
|
||||
{
|
||||
public class SimpleInterceptor : IAbpInterceptor, ITransientDependency
|
||||
public class SimpleInterceptor : IAbpInterceptor, /*IAbpAsyncInterceptor,*/ ITransientDependency
|
||||
{
|
||||
public void Intercept(IAbpMethodInvocation invocation)
|
||||
{
|
||||
(invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("BeforeInvocation");
|
||||
(invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("SimpleInterceptor_BeforeInvocation");
|
||||
invocation.Proceed();
|
||||
(invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("AfterInvocation");
|
||||
(invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("SimpleInterceptor_AfterInvocation");
|
||||
}
|
||||
|
||||
//public async Task InterceptAsync(IAbpAsyncMethodInvocation invocation)
|
||||
//{
|
||||
// (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("SimpleInterceptor_BeforeInvocation");
|
||||
// await invocation.ProceedAsync();
|
||||
// (invocation.TargetObject as ICanLogOnObject)?.Logs?.Add("SimpleInterceptor_AfterInvocation");
|
||||
//}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue