my global.asax looks like this
Imports Castle.Windsor
Imports Castle.Windsor.Configuration.Interpreters
Public Class MvcApplication
Inherits System.Web.HttpApplication
Implements IContainerAccessor
Private Shared IoC As IWindsorContainer
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
' MapRoute takes the following parameters, in order:
' (1) Route name
' (2) URL with parameters
' (3) Parameter defaults
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = ""} _
)
End Sub
Sub Application_Start()
RegisterRoutes(RouteTable.Routes)
IoC = New WindsorContainer(New XmlInterpreter)
End Sub
Public ReadOnly Property Container() As Castle.Windsor.IWindsorContainer Implements Castle.Windsor.IContainerAccessor.Container
Get
Return IoC
End Get
End Property
End Class
how do i access the Container property from within any Model Class? is there a class i can inherit from that gives me the "Application" property as in the view so i could to this
IoC = Application.Item("Container")...