I'm porting over some code that was previously written in .NET Framework to .NET Core.
I had something like this:
HttpResponseMessage result = await client.SendAync(request);
if (result.StatusCode != HttpStatusCode.OK)
{
IHttpActionResult response = ResponseMessage(result);
return response;
}
The return value of this function is now IActionResult
.
How do I take the HttpResponseMessage result
object and return an IActionResult
from it?