Reputation: 1816
I am trying to migrate my asp.net mvc web api project to visual studio 2015 preview version.
I am not finding a way to adopt the FilterConfig.cs code on visual studio 2015 since the 2015 version doesn't going to support global.asax, web.config.
So where i can put my filterconfig, areaconfig.
Upvotes: 2
Views: 858
Reputation: 657
You need to register your filters in the StartUp class, inside the ConfigureServices method:
public void ConfigureServices(IServiceCollection services)
{
// Add MVC services to the services container.
services.AddMvc().Configure<MvcOptions>(options =>
{
options.Filters.Add(typeof (MyGlobalFilterAttribute));
});
}
Upvotes: 2