title: How to display a custom message in HttpStatusCodeResult in MVC 6?
body: <p>In MVC 5 it was possible to provide a status description, e.g:</p>
  
  <p><code>return new HttpStatusCodeResult(500, "Could not connect to database");</code></p>
  
  <p>This is using <code>System.Web.Mvc.HttpStatusCodeResult</code>.</p>
  
  <p>In MVC 6 with <code>Microsoft.AspNet.Mvc.HttpStatusCodeResult</code> the only parameter is <code>statusCode</code>.</p>
  
  <p>Shaun Wildermuth mentions the problem in this <a href="http://wildermuth.com/2015/9/27/A_Look_at_ASP_NET_5_Part_5_-_The_API" rel="nofollow">post</a> - see Error Handling.</p>
  
  <p>How can I display a custom message in MVC 6?</p>