I have an attribute on a controller, controller action:
[InitialisePage(new[]{PageSet.A, PageSet.B})]
public ActionResult Index()
{
...
}
attribute:
public class InitialisePageAttribute : FilterAttribute, IActionFilter
{
private List<PageSet> pageSetList = new List<PageSet>();
public InitialisePageAttribute(PageSet pageSet)
{
this.pageSetList.Add(pageSet);
}
public void OnActionExecuting(ActionExecutingContext filterContext)
{
MySettings.GetSettings().InitialiseSessionClass(pageSetList);
}
}
When the action is called for the second time the constructor for the attribute isn't called? It just goes straight to the OnActionExecuting method, the pageSet list is still set.
I guess these are cached, where are they cached? Is this optional behavior?
thanks