You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to use the WebApi extension for the MicroLite ORM framework, you need to reference it in your solution. The easiest way to do this is install it via NuGet (if you are unfamiliar with NuGet, it's a package manager for Visual Studio - visit nuget.org for more information).
Install-Package MicroLite.Extensions.WebApi
Configuring the Extension
In the WebApiConfig class in the App_Start folder of your WebApi project, register the action filter(s) (only add the ones you want based upon the behaviour they introduce):
public static void Register(HttpConfiguration config)
{
...
// Add the MicroLite filters in the following order (for the ones you choose to use)
config.Filters.Add(new ValidateModelNotNullAttribute());
config.Filters.Add(new ValidateModelStateAttribute());
config.Filters.Add(new AutoManageTransactionAttribute());
}
See the following pages for further details about the attributes: