public override void OnActionExecuting(ActionExecutingContext context) { if (context.Result == null && !context.ModelState.IsValid) { Controller controller = (Controller)context.Controller; var validation = ValidateModel(context.ModelState); controller.TempData.TryAdd("errors", validation); context.Result = Inertia.RedirectBack(); } }