ASP.NET Core's ActionFilterAttribute
has these:
public virtual void OnActionExecuting(ActionExecutingContext context);
public virtual void OnActionExecuted(ActionExecutedContext context);
public virtual Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next);
I need an async version of OnActionExecuting
, which doesn't exist.
However I have a feeling that I can use OnActionExecutionAsync
instead, as it also has an argument of ActionExecutingContext
.
Am I correct that despite the name, they trigger at the same point in the process?
Also, what do I need to do with the next
argument? Once I'm done with my stuff, do I simply need to call await next()
?
Is that it? I'm unsure as I can't find docs for this.