0
goldstar25 created
Hi,How to add custom mvc filter in AbpModule by ASP.NET Core?There has no method look this:
private static void AddFilters(MvcOptions options)
{
options.Filters.AddService(typeof(AbpAuthorizationFilter));
options.Filters.AddService(typeof(AbpAuditActionFilter));
options.Filters.AddService(typeof(AbpValidationActionFilter));
options.Filters.AddService(typeof(AbpUowActionFilter));
options.Filters.AddService(typeof(AbpExceptionFilter));
options.Filters.AddService(typeof(AbpResultFilter));
}
3 Answer(s)
-
0
Hi,
You can do it in ConfigureServices method of Startup.cs. Include it like this:
services.AddMvc(options => { ........ options.Filters.Add(typeof(AbpAuthorizationFilter)); ........ });
-
0
But,How to set it in AbpModuleās PreInitialize methond?
-
0
I give up this way,I had to override the OnActionExecuting method inside the controller .