Base solution for your next web application
Open Closed

return custom response #9131


User avatar
0
inventiskr created

Hello,

I'm testing to return custom format of data to client in few controllers not all. Howevrer, I cannot figure out how I can return custom format of json different with abp guide.

for example,

A method returned, same as your guide,

{ "success": true, "result": {}, "error": null, "targetUrl": null, "unAuthorizedRequest": false, "__abp": true }

but I wanna change method B can returned like below,

{ "code": "1", "message": null, "data": null }

Thanks :)


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Try use DontWrapResult attribute.

    
    [DontWrapResult]
    public async Task<IActionResult> Test([)
    {
    
    }