AspectCoreDemo.CustomInterceptor.Invoke C# (CSharp) Method

Invoke() public method

public Invoke ( AspectContext context, AspectDelegate next ) : Task
context AspectContext
next AspectDelegate
return Task
        public async override Task Invoke(AspectContext context, AspectDelegate next)
        {
            try
            {
                Console.WriteLine("Before service call");
                await next(context);
            }
            catch (Exception)
            {
                Console.WriteLine("Service threw an exception!");
                throw;
            }
            finally
            {
                Console.WriteLine("After service call");
            }
        }
    }
CustomInterceptor