I am using Microsoft Unity (DI) container to inject my project dependencies.
I am using property dependency injection (DI) in one of my custom action filter using attribute.
Example:
public class SumCheck : ActionFilterAttribute
{
[Dependency]
public TestContext _context { get; set;}
public override void OnActionExecuting(HttpActionContext actionContext)
{
/* code */
}
}
Can i resolve dependency inside OnActionExecuting? So that whenever OnActionExecuting gets called, it resolves (gets new) instance of the class that implement ITestContext?