mvc and castle windsor - registratrion events
When I register components with castle's container in my app startup - should I see the registered classes being instantiated when I debug.
_container = new WindsorContai开发者_运维问答ner();
_container.Register(
AllTypes.FromAssemblyContaining<ValidationPatterns>()
.BasedOn(typeof(IValidator<>))
.WithService.Base());
Should I be able to see each of the relevant classes that fit the types i.e. inherit from IValidator, being instantiated?
Hope that makes sense
Windsor instantiates components on-demand, i.e. when they're resolved and no suitable instance (according to component lifestyle) is found. They're not instantiated at registration-time.
See "How components are created" for a more thorough explanation of the process.
精彩评论