public void OnActionExecuting(ActionExecutingContext context) { foreach (var argument in context.ActionArguments.Values.Where(v => v is ConfirmRegistrationRequest)) { ConfirmRegistrationRequest command = argument as ConfirmRegistrationRequest; _userValidationService.RequireValidConfirmationPhraseForInactiveUser(command.ConfirmationPhrase); } }