4using System.Threading.Tasks;
6using Microsoft.AspNetCore.Mvc;
7using Microsoft.AspNetCore.Mvc.Filters;
8using Microsoft.Extensions.Primitives;
9using Microsoft.Net.Http.Headers;
16 [Produces(MediaTypeNames.Application.Json)]
21 public sealed override async Task
OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
24 Response.Headers.Add(HeaderNames.CacheControl,
new StringValues(
"no-cache"));
27 () => base.OnActionExecutionAsync(context, next),
28 Request.HttpContext.RequestAborted);
30 if (errorCase !=
null)
31 await errorCase.ExecuteResultAsync(context);
40 protected virtual async ValueTask<IActionResult?>
HookExecuteAction(Func<Task> executeAction, CancellationToken cancellationToken)
42 ArgumentNullException.ThrowIfNull(executeAction);
44 await executeAction();
Base class for all API style controllers.
virtual async ValueTask< IActionResult?> HookExecuteAction(Func< Task > executeAction, CancellationToken cancellationToken)
Hook for executing a request.
override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)