Convert from HttpResponseMessage to IActionResult in .NET Core : <p>I'm porting over some code that was previously written in .NET Framework to .NET Core.</p>

<p>I had something like this:</p>

<pre><code>HttpResponseMessage result = await client.SendAync(request);
if (result.StatusCode != HttpStatusCode.OK)
{
    IHttpActionResult response = ResponseMessage(result);
    return response;
}
</code></pre>

<p>The return value of this function is now <code>IActionResult</code>.</p>

<p>How do I take the <code>HttpResponseMessage result</code> object and return an <code>IActionResult</code> from it?</p>
