Difference between MVC and WebAPI in ASP.NET 5 / MVC 6

MVC and WebAPI are combined for ASP.NET 5 / MVC 6, however I still want to be able to differentiate between the two.

Previously, different behaviors could be implemented as global filters in both MVC and Web API.

They are now merged in MVC 6, how can I force the global filter to apply its behavior to web API actions only?

+3


source to share


1 answer


You can categorize controller types into namespace or assembly. Create your own filter provider that extends the class DefaultFilterProvider

. The provider checks the controller namespace and returns the appropriate action filters.



+1


source







All Articles