Can I pass an argument from Action Filter to a controller and specifically through the parameters (in ASP.NET Core) ?
For example:
public class CategoryController : Controller
{
[HttpGet]
[ServiceFilter(typeof(ApiFilter))]
public async Task<IActionResult> Index(string dataComingFromActionFilter)
{
//use dataComingFromActionFilter
}
}
And
public class ApiFilter: IActionFilter
{
public void OnActionExecuting(ActionExecutingContext context)
{
//maybe something similar to
context.sendToActionAsArgument['dataComingFromActionFilter'] = "data";
}
}