title: fluent validation custom message and errorcode
body: <p>i'm using fluent validation (both 9 and 10 now..) to request validation in asp.net core 5 web application,
  i'm having some issues with custom messages and error codes...</p>
  <pre><code>public class FooRequest
  {
      public string foo1 { get; set; }
      public string foo2 { get; set; }
  }
  
  public class FooValidator :  AbstractValidator&lt;FooRequest&gt;
  {
      public FooValidator() : base()
      {
          RuleFor(r =&gt; r.foo1)
              .NotEmpty()
              .WithMessage($&quot;my message 1&quot;)
              .WithErrorCode(&quot;MY_ERROR_CODE_1&quot;); 
      }
  }
  
  //controller's action with DI
  [HttpPost(&quot;fooValidator&quot;)]
  public void fooValidator([FromBody] FooRequest fooRequest)
  {
  }
  </code></pre>
  <p>but i receive and unexpected response (without custom errorCode, and with customMessage inside the errorCode), where i'm wrong??</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;message&quot;: &quot;Bad Request&quot;,
      &quot;errorCode&quot;: &quot;my message 1&quot;
  }
  </code></pre>
  <p>P.S. if i change the validator, to set just customErorr</p>
  <pre><code>RuleFor(r =&gt; r.foo1)
      .NotEmpty()
      .WithErrorCode(&quot;MY_ERROR_CODE_1&quot;); 
  </code></pre>
  <p>i receive the default one:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;message&quot;: &quot;Bad Request&quot;,
      &quot;errorCode&quot;: &quot;'foo1' must not be empty.&quot;
  }
  </code></pre>
  <p>P.S.2 if i try to set the customMessage:</p>
  <pre><code>RuleFor(r =&gt; r.foo1)
      .NotEmpty()
      //.WithErrorCode(&quot;MY_ERROR_CODE_1&quot;)
      .WithMessage(&quot;my error message 1&quot;);
  </code></pre>
  <p>i receive the default message, with errorCode</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;message&quot;: &quot;Bad Request&quot;,
      &quot;errorCode&quot;: &quot;my error message 1&quot;
  }
  </code></pre>