I have a generic action filter, and i want to get current model in the OnActionExecuting method. My current implementation is like below:
public class CommandFilter<T> : IActionFilter where T : class, new()
{
    public void OnActionExecuting(ActionExecutingContext actionContext)
    {
        var model= (T)actionContext.ActionArguments["model"];
    }
}
It works well if my all model names are same. But i want to use differnet model names.
How to solve this problem?
Edit
public class HomeController : Controller
{
    [ServiceFilter(typeof(CommandActionFilter<CreateInput>))]
    public IActionResult Create([FromBody]CreateInput model)
    {
        return new OkResult();
    }
}
 
     
     
     
     
    