Hi, In the documentation it says:
ASP.NET Boilerplate does not wrap Web API actions by default if the action has successfully executed. But it handles and wraps for exceptions.
In the ResultWrapperHandler.cs inside Web.Api project, I noticed it starts as:
protected virtual void WrapResultIfNeeded(HttpRequestMessage request, HttpResponseMessage response)
{
if (!response.IsSuccessStatusCode)
{
return;
}
For this in contradiction to what documentation says unless I am looking at the wrong class.
Appreciate your feedback.
Thanks
7 Answer(s)
-
0
Hi,
This might be a documentation mistake, can you create an issue for aspnetboilerplate repository ?
Thanks.
-
0
Hi @drcgreece,
As we have checked, it works like expected and it is explained correct in the document. This class is called only for successfull results and the control you metioned is for when developers return error codes directly from webApi.
Thanks.
-
0
According to what you said: This class is called only for successful results and...
And given the documentation: ASP.NET Boilerplate does not wrap Web API actions by default if the action has successfully executed. But it handles and wraps for exceptions.
There is still something missing.
-
0
Hi,
The documentation refers to this class <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/ExceptionHandling/AbpApiExceptionFilterAttribute.cs">https://github.com/aspnetboilerplate/as ... tribute.cs</a>.
Thanks.
-
0
On this page: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Web-API-Controllers">https://aspnetboilerplate.com/Pages/Doc ... ontrollers</a>
Check the wrapping section towards the end of the page.
And then, this class below, when is it used then?
protected virtual void WrapResultIfNeeded(HttpRequestMessage request, HttpResponseMessage response) { if (!response.IsSuccessStatusCode) { return; }
-
0
Hi @drcgreece,
I understand your approach but as you can imagine we cannot explain every part of framework :). You can download ABP's source code and investigate it by yourself, if it does not work as expected, you can request help for that.
Why did you need that much deep information while using AspNet Zero ?
-
0
No problem. I need such detail as to understand how things run and that way I can debug issues more. Thanks