Sometimes inside FluentValidation validator I need to make redirect if state is incorrect (for example, I find that being deleted entity already does not exist and I redirect to the list of entities). Is validator a right place for this kind of logic? If yes, how can I RedirectToAction, RedirectToRoute, etc. from validator?
Sometimes inside FluentValidation validator I need to make redirect if state is incorrect (for
Share
No, validation shouldn’t control UI flow.
Normally something like this is appropriate inside of your controller: