VMD.RESTApiResponseWrapper.Net 1.0.0

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VMD.RESTApiResponseWrapper.Net" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VMD.RESTApiResponseWrapper.Net --version 1.0.0
#r "nuget: VMD.RESTApiResponseWrapper.Net, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

  1. Declare the following namespace within WebApiConfig.cs

using VMD.RESTApiResponseWrapper.Net; using VMD.RESTApiResponseWrapper.Net.Filters;

  1. Register the following within WebApiConfig.cs

config.Filters.Add(new ApiExceptionFilter()); config.MessageHandlers.Add(new WrappingHandler());

  1. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 2,315 5/1/2018
1.0.2 1,076 4/28/2018
1.0.1 948 4/26/2018
1.0.0 870 4/18/2018

Initial release