title: WebAPI my own Status Code
body: <p>I use WebApi 2 and have an idea to use own status codes (from 452 till 499) for bad request. </p>
  
  <p>i.e: user has no required role - code is 452, operation is not completed by reason #1 - code is 453, by reason #2 - code is 454 etc...</p>
  
  <p>Problem is I return <code>HttpResponseMessage</code> and it allows to return only <code>HttpStatusCode</code> enumeration, which has only pre-defined (standard) status codes</p>
  
  
  
  <pre><code>public async Task&lt;HttpResponseMessage&gt; PasswordRecoveryAsync(PasswordRecoveryApiModel model)
  {
      var user = await UserManager.FindByNameAsync(model.Username);
      if (user == null)
          return Request.CreateErrorResponse(HttpStatusCode.NotFound, "User with such username is not found");
  
      if (user.AspNetRoles.Where(p=&gt;p.Name == Models.Roles.Editorial).Count() == 0)
          return Request.CreateErrorResponse(HttpStatusCode.NotFound, "...")
  
      ....
  
      return Request.CreateResponse&lt;string&gt;(HttpStatusCode.OK, "Confirmation token is sent to your email");
  }
  </code></pre>
  
  <p>Is my idea good or not? If good, then how do I solve it?</p>