abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.87k stars 3.44k forks source link

How do I wrap WebAPI Like Abp Boilerplate #8805

Closed lament0 closed 3 years ago

lament0 commented 3 years ago

When I write an WebApi with ABP.VNEXT, it returns a variety of values, and I find that the ABP BoilerPlate has the [ WarpResult ] Or [DontWrapResult] Attribute to control whether to wrap the return value,Like Switch.

This is ABP BoilerPlate AjaxResponseBase { result: null, "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true } image image image

I want something like [ WarpResult ] Attribute to control my webAPI in volo.Abp

maliming commented 3 years ago

You can implement it yourself.

https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Results/AbpResultFilter.cs#L10