A Month ago, the 3rd version of the RC has been released to test out .NET 5 support. Alot of code refactoring has been done for v5 and there are breaking changes. I would really appreciate if you could test it out as well to better improve this project and to ensure we capture every scenario before rolling out an official v5 release.
AutoWrapper is a simple, yet customizable global
HTTP exception handler and response wrapper for ASP.NET Core APIs. It uses an ASP.NET Core
middleware to intercept incoming
HTTP requests and automatically wraps the responses for you by providing a consistent response format for both successful and error results. The goal is to let you focus on your business code specific requirements and let the wrapper automatically handle the
HTTP response. This can speedup the development time when building your APIs while enforcing own standards for your
HTTP responses. For more information, see: AutoWrapper on Github.
- This release only supports .NET 5.
- Middleware has been renamed from
UseAutoWrapper. Make sure to update your
Startup.csto use the new name.
ProblemDetailsis now the default exception format.
UseApiProblemDetailsExceptionhas been renamed to
Newtonsoft.Jsondependency and replaced it with
- Use the interface
IApiResponsemodel instead of the concrete
ApiResponse. model for returning responses using the default format. This allows you to add your own properties that will wrapped within the
RequestDataLogIgnoreattributes now leaves under
AutoWrapper.Attributesnamespace. The implementation was changed from using
Attribute, eliminating all the request header logic.
The following options has been removed:
DefaultContractResolveraren't still supported.
- Download and Install the latest
AutoWrapper.Corefrom NuGet or via CLI:
PM> Install-Package AutoWrapper.Core -Version 5.0.0-rc-03
- Declare the following namespace within
- Register the
middlewarebelow within the
That's simple! Please provide feedback if there are any issues you encountered. Thank you!