How to get current model in action filter
问题 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