Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Want to pass parameters to a Validator yet be Efficient

$
0
0
Hi, new to Fluent here...

What is the proper way to pass a parameter (of my choosing) to a validator, (called from an mvc controller action) and have the validation act on that parameter? This parameter can be different on every use of the validator.

I know I can pass a parameter to the validator constructor, but then I'd have to instantiate a new validator on every controller request, no? (How efficient/inefficient is that?)

Is it better to do it with an IoC solution passing around a single validator? What is the proper way to do it this way? Also, if I were to do this, is there any chance of concurrent requests clobbering each other?

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>