title: How to retrieve HTTP Code and Content from IActionResult?
body: <p>I've 7 actions in my controllers. I've refactored them an was able to isolate the common portion.</p>
  
  <pre><code>public IActionResult Get()
  {
      var response = CommonCode();
  }
  
  public IActionResult Get(guid id)
  {
      var response = CommonCode();
  }
  
  public IActionResult Post(ViewModel vm)
  {
      var response = CommonCode();
  }
  </code></pre>
  
  <p>This is where I refactored the common code.</p>
  
  <pre><code>provate IActionResult CommonCode()
  {
     if(userHasNoPermission())
       return Forbid();
  
     if(IdProvidedDoesntExist())
       return BadRequest();
  
     //...
  }
  </code></pre>
  
  <p>When I look inside the <code>response</code>, I see only one method: <code>ExecuteResultAsync()</code>.</p>
  
  <p>Is there a way to retrieve the HTTP code that I sent inside the helper method? </p>
  
  <p>I'd like for instance to stop the processing if it's <code>500</code>, retrieve the message to add to the <code>ModelState*</code> if it's <code>400</code>, but proceed if it's <code>OK</code>.</p>