title: How to set options in FluentValidation?
body: <p>I'm using <code>FluentValidation</code> in <code>ASP.NET Core 3.1 Web API</code>. When there is a validation error, <code>FluentValidation</code> returns list of errors with field names (or <code>{PropertyName}</code>). The problem is it is normalizing them: For example UserId, is changed to &quot;User Id&quot;. I want to keep the original property name in the error.</p>
  <p>I found similar issue <a href="https://github.com/FluentValidation/FluentValidation/issues/1294" rel="nofollow noreferrer">here</a>. The solution is: <em>&quot;you can turn it off globally by setting ValidatorOptions.DisplayNameResolver to a custom function in your application’s startup routine.&quot;</em>. I also found this on their official website:</p>
  <pre><code>ValidatorOptions.DisplayNameResolver = (type, member, expression) =&gt; {
    if(member != null) {
       return member.Name + &quot;Foo&quot;;
    }
    return null;
  };
  </code></pre>
  <p>But my (rookie) question is: How can I add these options to my project?? This is my <code>Startup</code> class (<code>opt</code> doesn't have <code>DisplayNameResolver</code>):</p>
  <pre><code>        services.AddControllers()
              .AddFluentValidation(opt =&gt;
              {
                  opt.RegisterValidatorsFromAssemblyContaining(typeof(PlayerInputValidator));
              });
  </code></pre>