question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dont Wrap result is not working with a non abp controller

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

7reactions
ahmedhassiebcommented, Jan 24, 2018

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 ?!

1reaction
acjhcommented, May 16, 2018

This issue was fixed in ABP v3.5.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aspnetboilerplate - Disable Wrapping of Controller Results
I dont have direct access to the MetadataController so i am unable to add the attribute. Is there anyway to disable wrapping for...
Read more >
[DisableValidation] and [DontWrapResult] do not work in ...
I've tried [DisableValidation] and [DontWrapResult] on the controller as well as the controller methods but it does not seem to have any effect....
Read more >
DontWrap Result by header info, or another way #7259
Hi there, We now have a couple of finished AspnetZero applications, and we started using some of their api's like login and other...
Read more >
Articles Tutorials | AspNet Boilerplate
AbpExceptionFilter is used to handle exceptions thrown from controller actions. It handles and logs exceptions and returns a wrapped response to the client....
Read more >
This is a simple controller derived from AbpController
You can change exception handling and wrapping by using the WrapResult and DontWrapResult attributes for controllers or actions or from the startup ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found