aspnetboilerplate: Dont Wrap result is not working with a non abp controller

I’ve added DontWrapResult attribute above the controller as shown in the example below and it keeps wrapping the result server code

    [IgnoreAntiforgeryToken]
    [ApiExplorerSettings(IgnoreApi = true)]
[DontWrapResult(WrapOnError = false, WrapOnSuccess = false, LogError = true)]
    public class ReportsController : ReportsControllerBase, ITransientDependency
    {
        public ReportsController(IHostingEnvironment environment)
        {
            
        }

    }

response -> {error: null, result:{clientId: “111254-b556”}, clientId:“111254-b556”, success:true, targetUrl:null, unAuthorizedRequest:false, __abp:true }

I’ve other controllers which inherit from AbpController and they have the same attribute and they don’t wrap the result only this controller that Inherits from non Abp Controller is not affected by the attribute.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (16 by maintainers)

Commits related to this issue

Most upvoted comments

hi @hikalkan well, I saw the test code you wrote but we need only the attribute to work on the Telerik report base controller, however, I tried to add the below lines in the web module instead of the controller attribute

Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnSuccess = false;
Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnError = false;

and the controller is working fine but this is not the right way as we stopped wrapping all results for all the controllers in the ABP web project … any suggestions ?!

This issue was fixed in ABP v3.5.0.

I want to add a comment to this issue. I was first searching for anything related to the use of Telerik’s .NET Core controls.

Then I got lead to this issue.

My problem is regarding the using of Grid control on a page, totally basic setup, with 2 columns, no fancy stuff.

The grid would not show the data that it received (it rendered rest of the grid fine), until I appended the below code to my method that outputs the JSON data:

[DontWrapResult(WrapOnError = false, WrapOnSuccess = false, LogError = true)]

Regards