I am using MVC 3, I have a range of Controllers depending on various repositories, 1 of my repository relies on the http context session. I have created interfaces for each of my repositories in order to use the Windsor-Castle IoC.
How can I pass the current session object down to the repository that needs it?
I used to be able to do this and the "Resolve" would take care passing the session to the repository that needed it, somehow I cannot do this in the latest version (2.5.3 Feb 2011):
Protected Overrides Function GetControllerInstance(ByVal requestContext As System.Web.Routing.RequestContext, _
ByVal controllerType As System.Type) As System.Web.Mvc.IController
Dim match As IController
' 1 or more components may need the session,
' adding it as a (possible) dependency
Dim deps As New Hashtable
deps.Add("session", HttpContext.Current.Session)
match = container.Resolve(controllerType, deps)
Return match
End Function
Thanks, Vincent