VMD.RESTApiResponseWrapper.Net
1.0.0
See the version list below for details.
dotnet add package VMD.RESTApiResponseWrapper.Net --version 1.0.0
NuGet\Install-Package VMD.RESTApiResponseWrapper.Net -Version 1.0.0
<PackageReference Include="VMD.RESTApiResponseWrapper.Net" Version="1.0.0" />
paket add VMD.RESTApiResponseWrapper.Net --version 1.0.0
#r "nuget: VMD.RESTApiResponseWrapper.Net, 1.0.0"
// Install VMD.RESTApiResponseWrapper.Net as a Cake Addin #addin nuget:?package=VMD.RESTApiResponseWrapper.Net&version=1.0.0 // Install VMD.RESTApiResponseWrapper.Net as a Cake Tool #tool nuget:?package=VMD.RESTApiResponseWrapper.Net&version=1.0.0
STEPS to use the RESTApiResponseWrapper.Net
- Declare the following namespace within WebApiConfig.cs
using VMD.RESTApiResponseWrapper.Net; using VMD.RESTApiResponseWrapper.Net.Filters;
- Register the following within WebApiConfig.cs
config.Filters.Add(new ApiExceptionFilter()); config.MessageHandlers.Add(new WrappingHandler());
- Done.
To use the Custom API Exception, you could do:
throw new ApiException("Your Message",401, ModelStateExtension.AllErrors(ModelState));
The ApiException has the following parameters:
ApiException(string message, int statusCode = 500, IEnumerable<ValidationError> errors = null, string errorCode = "", string refLink = "")
For ASP.NET Core Folks
You can try download the .NET Core version of this wrapper at https://www.nuget.org/packages/VMD.RESTApiResponseWrapper.Core/
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- Microsoft.AspNet.WebApi.Client (>= 5.2.4)
- Microsoft.AspNet.WebApi.Core (>= 5.2.4)
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release