ASP.NET MVC 3: Validating model when information external to the model is required

后端 未结 4 993
南笙
南笙 2020-12-14 22:30

What\'s a good way to validate a model when information external to the model is required in order for the validation to take place? For example, consider the following mod

4条回答
  •  醉酒成梦
    2020-12-14 23:23

    You could try fluent validation. It supports asp.net mvc and DI so you can inject external services into your validators.

提交回复
热议问题