public void OnActionExecuting(ActionExecutingContext context) { foreach (var argument in context.ActionArguments.Values.Where(v => v is LoginRequest)) { LoginRequest command = argument as LoginRequest; _userValidationService.RequireValidPasswordForExistingUsername(command.Password, command.Username); } }