Link to this CodePlex unity article I managed to get a filter attribute that works with a WebAPI controller as follows:
[MyFilterAttribute] public class TestController : ApiController {}
However, if I want to apply my filter attribute to all actions using GlobalConfiguration, it will be deprived of a nested dependency:
public class MyFilterAttribute : ActionFilterAttribute { [Dependency] public MyDependency { get; set; } public override void OnActionExecuting(HttpActionContext actionContext) { if (this.MyDependency == null)
Is there a better place to add a global configuration?
c # asp.net-web-api unity-container
Blake blackwell
source share