Closed eByte23 closed 4 years ago
Hi!
Thanks for your PR, sorry for the delayed review.
Actually I'v been thinking about how to enable using different result objects than just string
s, and I might rework this part in the future, but I think this PR is a good first step.
Can you please write two new unit tests, one for testing the IActionResult
-case, one for testing when the response is object
?
Thanks for the reply, I'll make the changes and add some tests a little later today.
@markvincze I have rebased the pr, resolved all comments and added the requested tests. If there are any other changes you'd like let me know. Cheers
@eByte23,
I'm afraid there is a problem now, in the new version we're not setting the status code, because this line:
httpContext.Response.StatusCode = StatusCodeProvider(httpContext.Request, arguments);
was removed, so we're returning 404
instead of 200
. You'll see if you run all the tests locally.
I guess if you add that to the same place it was, that'll be the correct behavior, right? Because the ActionResult-branch possibly runs afterwards, and it can still change the status code to what it wants.
And unrelated issue is that we have a problem with the CI build, it doesn't really run the tests. I'll try to fix that separately on master.
Sorry about that missed it in the rebase as it was the same line as the response.write before.
Should have revert that now, tests ran locally fine.
Great, thanks for the contribution! I'll merge the PR now, and will release the new package a bit later, probably today.
Sorry for the delay, I released 2.5.0 now, it includes the PR.
No problem at all much appreciated
This PR put support for return result that Inherit from IActionResult e.g. FileContentResult etc.. The dependency on Mvc DI extension is for IActionExecutor which would be used for a lot of different ActionResult's