I have my base controller and action filter in the same namespace but in different classes. I created a class inside of the base controller which requests http headers, and I would like to call that method inside of my action filter.
If I do a simple Details dtls = GetHeaders() the intelliSense asks if I want to create another method GetHeaders() inside of the action filter.
So my question is can I call the GetHeaders() method inside of the BaseController class directly from the action filter? How would I do so? If not, how could I call that method?
namespace Infrastructure
{
public class BaseController
{
public Details GetHeaders()
{
//Get the headers
}
}
public class MyFilterAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
//Call GetHeaders() to get Header1 data
}
}
}