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
Trevor Pilley edited this page Feb 16, 2017
·
21 revisions
In order to use the MVC 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.Mvc
Configuring the Extension
Register the action filters for the behaviour you want in your FilterConfig in the App_Start folder of your project:
publicstaticvoidRegisterGlobalFilters(GlobalFilterCollectionfilters){// this is part of ASP.NET and usually already addedfilters.Add(newErrorHandlerAttribute());// Add the MicroLite filters you want to use in the following order:filters.Add(newValidateModelNotNullAttribute());filters.Add(newValidateModelStateAttribute());filters.Add(newAutoManageTransactionAttribute());}
See the following pages for further details about the attributes: