Top "Action-filter" questions

In ASP.

How can you unit test an Action Filter in ASP.NET Web Api?

I was looking to add an Action Filter to my service to handle adding link data to the response message. …

.net unit-testing asp.net-web-api action-filter
How do I get the current Url from within a FilterAttribute?

I am writing an Authorize filter attribute adn I'm having trouble figuring out how to get the current url as …

asp.net-mvc url authorization action-filter actionfilterattribute
Best way to abort/cancel action and response from ActionFilter

Best way to abort/cancel action from ActionFilter I've got this ActionFilter, and it's suppose to end the connection immediately …

asp.net asp.net-mvc action-filter
Asp.net Web API - return data from actionfilter

I want to return a json object from the wep api actionfilter. How can I achieve this? I can return …

c# asp.net-web-api action-filter
Register global filters in ASP.Net MVC 4 and Autofac

I have a filter like this one: public class CustomFilterAttribute : ActionFilterAttribute, IAuthorizationFilter { public MyPropery Property { get; set; } .... } I need it …

asp.net-mvc-4 autofac action-filter asp.net-mvc-filters
return status code Unauthorized for custom IActionFilter in WebAPI

I am working with asp.net WebAPI and I need to create a custom ActionFilter that does a quick check …

asp.net-mvc-4 asp.net-web-api action-filter
Async OnActionExecuting in ASP.NET Core's ActionFilterAttribute

ASP.NET Core's ActionFilterAttribute has these: public virtual void OnActionExecuting(ActionExecutingContext context); public virtual void OnActionExecuted(ActionExecutedContext context); public virtual …

c# asp.net-core action-filter
Convert custom action filter for Web API use?

I found a really nice action filter that converts a comma-separated parameter to a generic type list: http://stevescodingblog.co.…

c# asp.net-mvc c#-4.0 asp.net-web-api action-filter
ASP.NET MVC: Register action filter without modifying controller

I'm working with nopCommerce and I need to add in my only Action Filter, however, I don't want to modify …

c# asp.net-mvc action-filter
How to use Action Filters with Dependency Injection in ASP.NET CORE?

I use constructor-based dependency injection everywhere in my ASP.NET CORE application and I also need to resolve dependencies in …

c# asp.net asp.net-mvc asp.net-core action-filter