We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The existing model validation system doesn't allow a controller action to specify a model validator. Ideally we'd be able to say something like:
[HttpGet] public IHttpActionResult Action1( [CustomizeValidator(RuleSet = "Rule1")]MyModel widget) { return Ok(); } [HttpGet] public IHttpActionResult Action2( [CustomizeValidator(RuleSet = "Rule2")]MyModel widget) { return Ok(); }
As is we're forced to introduce types like so:
[ValidateModel("Rule1")] public class Action1Model : MyModel { } [HttpGet] public IHttpActionResult Action1( Action1Model widget) { return Ok(); } [ValidateModel("Rule2")] public class Action2Model : MyModel { } [HttpGet] public IHttpActionResult Action1( Action2Model widget) { return Ok(); }
FluentValidation supports this via a IModelBinder attribute in MVC, but has nothing comparable in WebApi.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The existing model validation system doesn't allow a controller action to specify a model validator. Ideally we'd be able to say something like:
As is we're forced to introduce types like so:
FluentValidation supports this via a IModelBinder attribute in MVC, but has nothing comparable in WebApi.
The text was updated successfully, but these errors were encountered: