So I talked briefly here about how I have a global filter that runs GlobalFilters.Filters.Add(new MyFilter)
and obtains a subdomain manager which will conduct some database look up based on subdomain information.
My goal was to have the filtercontext.result set to a new ResultRedirect object if the validations I am conducting fails. However, if it is successful, this Subdomain manager object will persist in the Structuremap Container for the remainder of the request.
Originally I had believed that the controller object was not instantiated when the global filters ran so I had expected to populate a subdomain object property on the controller based on the results of this subdomain manager.
However, I have two delemma's:
I believe the controller has been instantiated when the global filter runes, so even if the global controller that runs the subdomain manager and validates the request is validated, I can't populate the subdomain object on the on my controller from the subdomain manager object that is in the container
Secondly, and more largely, I can't seem to find a valid way to inject dependencies into my Global filter (SomeValidationAttribute : ActionAttribute) using structuremap.
Any suggestions