, , .Resolve<T>, , , . @Steven, Windsor, (/ ). , WindsorContainer , .
( MyThingyManager), . , ASP.NET MVC , . MVC3 DependencyResolver, .
, , Windsor , , (). , .
, :
public class Installer : IWindsorInstaller
{
public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
{
container.Register(
Component.For<IMyThingManager>().ImplementedBy<MyThingManager>(),
Component.For<IFooRepository>().ImplementedBy<FooRepository>()
);
}
}
Global_asax.cs Application_Start - :
var container = new WindsorContainer();
container.Install(FromAssembly.This());
container.Install(FromAssembly.Containing(typeof(ComponentThatContains.MyThingManager.Installer)));
.
, .