Reputation: 667
I've seen it somewhere but couldn't find it anymore. Something like the following:
public class Startup {
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers()
.AddFluentValidation(s =>
{
s.ValidatorOptions.CascadeMode.Stop;
...
Upvotes: 0
Views: 274
Reputation: 667
Response from JeremySkinner the library maintainer:
Either:
using FluentValidation;
services.AddMvc().AddFluentValidation(fv => {
fv.ValidatorOptions.CascadeMode = CascadeMode.Stop;
});
Or just:
ValidatorOptions.Global.CascadeMode = CascadeMode.Stop;
Both have the same result (they're the same configuration instance)
Upvotes: 0
Reputation: 5977
I believe it should be:
ValidatorOptions.CascadeMode = CascadeMode.Stop;
Upvotes: 1