Reputation: 4494
I integrate web api 2 request in mvc 5 project. How can I check request coming for mvc or web api controller?
Upvotes: 1
Views: 2086
Reputation: 263
The most correct way would be to create a class that inherits ActionFilterAttribute
and override OnActionExecuting
method. This can then be registered in the GlobalFilters in Global.asax.cs
Of course, this will only intercept requests that actually have a route.
Upvotes: 1